It is actually very easy. You can use the program RSD Lite. Here are the steps:
1. Connect your phone with datacable and run RSD Lite
2. Click "Browse" and find the firmware (MUST BE FIRMWARE FOR YOUR MODEL! DIFFERENT FIRMWARE WILL KILL IT)
3. Click "Flash" (or whatever button it was) and the program will do the rest for you
P.S. Usually the program will switch your phone to bootloader automatically. Also note that sometimes you must remove the battery after flash (only if the phone do not start)
P.S.2. Flashing will ruin your warranty