Gerunds can appear at the beginning of a sentence when used as a subject:
Gerunds can act as an object following the verb:
A present participle clause can express:
Tom lost his keys (while) walking through the park. (Tom lost his keys while he was walking through the park.)
She left the room singing happily. (She left the room as she was singing happily.)
The participle clause can come first in literary styles:
(While) walking through the park, Tom lost his keys.
Before Opening the envelop happilye, I found two concert tickets. (I opened the envelope and I found two concert tickets.)
After finishing my work of art, I relax
When painting on canvas, I use ink or spray paint
https://webapps.towson.edu/ows/exercises/participles_gerunds_ex3.aspx
https://www.englishgrammar.org/gerunds-present-participles/
https://www.englishpractice.com/grammar/participles-gerunds-exercise/
https://www.ego4u.com/en/cram-up/grammar/participles/exercises
https://www.proprofs.com/quiz-school/story.php?title=grammar-mastery-quiz-chapter-17-participles-gerunds-infinitives