What is the proper way to connect the 7812 as seen in the image attached?

The way I had it, the part heated up so much the solder joints...