To prove an identity, we alter one side only. The other side stays the same.
The steps above show the left hand side (LHS) transforming into the right hand side (RHS).
The RHS stays the same the entire time.
Since the RHS has cosine and sine, this is a hint to turn the tangent on the LHS into its equivalent form involving sine over cosine.
tan = sin/cos
which is of course the informal way to write this rule.