I need help trying to figure out how my teacher got from

(x^2+6x+9) + (y^2-4y+4)= 12+9+4

to

(x+3)^2 + (y-2)^2= 25

First the easy part:

12+9+4=25

To understand how the left hand side works, you can work backwards, and try to expand using the FOIL rule:
(x+y)²
=(x+y)(x+y)
=x*x + x*y + y*x + y*y
=x² + xy + xy + y²
=x² + 2xy +y²

Now put x=x, y=3,
(x+3)²
=x² + 2(3x) + 3²
=x² + 6x + 9
which is the first expression in parentheses.

If you repeat the same exercise, you will get
(y-2)²
=y²-4y+4
equal to the second expression in parentheses.

Your teacher simply did the reverse process, called factorization.