Get to know to avrdude.
You need a programmer, for example USBasp or and Arduino as ISP.
See this site for the fuses: http://www.engbedded.com/fusecalc
Use a few blank chips and write the EEPROM and flash and fuses, and try to read them back.
You have to know what to fuses do, since they can prevent further communication.
Once you know all that, read the programmed chip and try to copy that into another chip.