How to Solder
Electronics solder contains cores of something called rosin. Rosin is a blend of chemicals specifically formulated for use as a flux around electronics. It is important to always check that the solder you are using is rosin-cored .
With components on a circuit board, this means bending the legs at a 45-degree angle once they’re inserted through the circuit board, so they cannot move easily. 
In the case of integrated circuits, it is often sufficient to bend one leg at each end, diagonally opposite, to hold the chip in place.
Once a mechanically sound, clean connection is ready, you can heat up your soldering iron. The choice of equipment here is critical. A 120W sheet metal worker’s soldering iron will dump so much heat that the circuit board will be destroyed. A 25W circuit board iron will never heat a 4-gauge car audio power cable. For reasons such as these, one of the best pieces of equipment you can own for electronics is a soldering station, which allows a variable temperature setting.
The aim is to introduce enough heat to heat the joint quickly and melt the solder, while not putting in so much that things get cooked.
Here is another critical point: insufficient heat means that the heat gets drawn away from the joint faster than it is put in. In this scenario, the joint never reaches temperature or takes a long time to do so; however, in the meantime the component is being heat-damaged. So ideally, you need to strike a balance between a temperature and power that will heat the joint quickly and then be removed, yet without introducing too much heat. Unfortunately, this is often a matter of experimentation. Remember, metals are good at conducting heat as well as electricity
Adding the actual solder to the joint is the real art, and often another reason that people come unstuck. The correct procedure is to add a little solder to your iron’s tip – just enough to allow a better surface area to conduct heat. Wipe the soldering iron on the wet sponge, then hold the solder against the two surfaces to be soldered (not against the iron tip), and allow the joint to heat up. When it reaches temperature, the joint will melt the solder, allowing it to flow into the relevant places. 
Then, withdraw the iron and solder at the same time, and wipe the iron clean. What you should see now is a smooth, shiny surface that appears to be seamlessly joined to the circuit board surface and component leg, or to both wires. If there are cracks, a dull surface, or a volcano-like crater at the top or a line around the bottom, the joint is likely not making a good connection . In which case, reheat, remove the solder, and try again.
All that remains now, is to trim the component legs off your board. This is best done with a pair of small side cutters that have a flush cutting surface (not a bevelled one). You should trim closely to the solder but not cut into the solder.
Some Helpful tools
There are some things that make soldering much easier. The first is a solder sucker. These are available in both spring plunger and squeeze bulb form. Simply reheat the joint, position the desolder tool near the joint and trigger. The solder should largely be removed.
The second helpful tool is a set of helping hands. These are a metal frame with clips to hold the circuit board or pair of wires, allowing both your hands to be used for holding and carefully applying the iron and solder.