If you want to make a specific term the subject, you need to isolate it on one side of the equation. You do this by 'getting rid' of anything on the term's side of the equation, starting with whatever's furthest from the term. (think BEMDAS but backwards)
p = 6q + 7
<em>(take 7 from both sides to get rid of +7 on q's side)</em>
p - 7 = 6q + 7 - 7
p - 7 = 6q
<em>(divide both sides by 6 to get rid of 6 on q's side)</em>