First you need to have the squared coefficient free, that is, equal to 1.

You do this by factoring,

Factor,

Now look at the linear terms (2 and -6)

Add half the number squared and subtract,

Distribute in the following strange way,

You are about to see why we distribure like that.

Now you should see the perfect squares.

Bring to the other side the free terms,