Squaring both sides - confusion

a-b = 3
if i square both sides, how will i know when to use the identity (a-b)^2 or to use (a-b)(a+b) ?

(a - b)^2 = (a - b)(a - b)