I was given an ATmega8U2 chip by my friend and I have been doing a bit of research about it. It says it does not come with a pre-programmed with a boot loader, so I was just interested about how to go about getting a c program on there? Do I have to download a boot loader to the chip or something?
You need a programmer/debugger. Atmel (now Microchip) sells a suitable device, or you could use an Arduino with suitable software as a programmer only. The latter will be a lot cheaper.