(My last message wouldn't send so I'll make this quicker) I removed old heatsink to see if it was the thing failing and it was so I found a newer one and replaced the older one with the newer one. there was a bent peg and a I was missing a peg (the thing that connects to the motherboard) so I took a few off the old one and attached them to the new one. Didn't use thermal compound because there was still some on CPU and heatsink and I didn't have any. My problem is that PC turns off after 30 seconds and can't access the bios in that time.
Extra: The CPU is a old Pentium D
Motherboard is a gigabyte GA-8I955x PRO http://www.gigabyte.com.au/products/product-page.aspx?pid=1903#ov
And the heatsinks are both Intel stock heatsinks with slightly different fan fins.
Since the CPU is a Pentium D I will assume it is a socket 775.