I'm completely new in this areas. Can anyone tell me how to do it? Thank you!
To do this, you will require a part with on-chip non-volatile program storage. In the Old Days, that meant UV-EPROM. These required exposure to UV light to erase them, and high voltages to program. Therefore, a special programmer was required - the chip had to be taken out of the target board, programmed in the programmer, then replaced in the target board. To let the UV light in required an expensive ceramic package with a quartz window. Cheaper versions called "One-Time Programmable" (OTP) were available; they were cheap because they used ordinary plastic packaging with no window - so, once programmed, they could never be erased and, therefore, could never be re-programmed. Hence "One-Time" Programmable! Many modern chips have Flash built in, and no longer require special programming voltages. Therefore, these parts can be programmed while still in the target board - called "In-System Programming" (ISP). This is vastly more convenient, and obviates the need for sockets, erasers & programmers, removes the potential for damage with repeated socket insertions, etc, etc, etc. The board needs to be designed to accomodate this, but the vendor's literature will show you clearly how to do it. As you say you are new to all this, you should certainly not waste your time messing about with old UV-EPROM based chips. Get a modern, Flash-based, In-System Programmable part. You may also hear of "In-Application Programming" (IAP). This refers to a system that can update its own code while it's running! You should regard this as an advanced topic for now... ;-)
Oo... i get it!!