The Golden Rule of Verbal Adverbs
Verbal adverbs (деепричастия) let you connect a background action to a main action, condensing your sentences. They translate roughly to English phrases like "while reading" or "having closed."
In Russian, there is one unbreakable rule for using them: the main verb and the verbal adverb must share the exact same grammatical subject. If the subject of the main verb is "he," then "he" must also be the one performing the background action. You cannot say "Walking down the street, my phone rang" in Russian, because the phone was not walking.
Simultaneous Actions (-я)
To describe a background action that happens at the same time as the main action (perfect for describing multitasking), use an imperfective verbal adverb. These are formed from imperfective verbs and usually end in -я (or sometimes -а).
Consecutive Actions (-в)
To describe a background action that was completed before the main action began (meaning "having done X, the subject did Y"), use a perfective verbal adverb. These are formed from perfective verbs and typically end in -в (or occasionally -вши).
Punctuation and Placement
Unlike in English, where comma rules for "-ing" phrases can sometimes be flexible, Russian punctuation here is very strict. A verbal adverb and any words attached to it (a деепричастный оборот) must always be set off from the rest of the sentence by commas, no matter where the phrase appears in the sentence.