I've seen so many articles on electronic soldering that are either overly verbose and hard to read, too complex for a beginner, insist on expensive tools, or are just plain wrong, that I decided to clear the air a bit by going back to the basics. When I first started soldering, many years ago, "How To Solder" was printed on the back of the soldering iron package with room to spare. After that, it was just practice. This is not hard stuff, and it's not complicated, either. It's just a matter of a handful of basic principles:
I learned many of these techniques on a production line in the 80s, so I've done a lot of hand soldering.
The Soldering Comic Book attached is a good quick reference.
Step 1: Choose the Right Soldering Utensil
To solder electronics, you need a soldering iron, not a soldering gun. Soldering guns are designed for large, bulky projects like copper pipe or gutters. They are too imprecise and too powerful for delicate soldering. In addition, they work by putting current directly through the tip, and that current could potentially damage sensitive semiconductors.
Your first soldering iron should be in the 25-40 Watt range. It does not need to be one of those fancy ones with temperature control. I've been using non-temperature-controlled irons for decades, and they do just fine for all but the most demanding jobs. The $10 one from Radio Hovel or WalMart will do just fine when you're starting out. You'll know when your work demands something better.
If you'll be soldering a lot of CMOS ICs (integrated circuits), they are static sensitive, and a grounded iron with a 3-prong plug will help, or just solder in IC sockets and put in the ICs when all soldering is done. This is safer, anyway, until your skills are better.
Step 2: Use Solder and Flux designed for Electronics
You want only Rosin Core Solder for soldering electronics. The rosin acts as flux (A substance that helps prevent oxidation and promotes bonding). Flux is essential, but the wrong kind of flux will destroy your project. Acid core solder should be paired with that soldering gun, and used only for plumbing and home repairs. The kind of solder you can buy at Radio Shack is the right kind.
Choose a diameter of solder based on the size of your soldering job. Diameters are given in Inches. For general electronic soldering, .025" or .030" is OK. For fine work like Surface Mount components, use .015 or even .010. I've been using .015 for nearly everything, but for a big connection like an AC plug, you might have to use a foot of the stuff.
Note: Lead-free solder is environmentally correct, but a lot harder to work with and requires higher temperatures. I don't recommend it. The best kind is 63% Tin/37% Lead, although 60/40 works fine also.
Step 3: Safety Concerns
I am assuming that you're grown-up enough to realize that soldering irons get Hot! Around 500-750 degrees F hot. (260-400 C for our friends across the Pond.) If you don't understand this, blow out a few more Birthday candles first.
Anyway, protect yourself from possible hot splatters with the appropriate gear. Safety glasses are a good idea. I'm not responsible if you hurt yourself, or burn your house down. And by the way, picking up a hot soldering iron by the wrong end is definitely not recommended. (Ask me how I know.)
You also don't want to breathe any more of the smoke and fumes than you have to. A small fan to keep the smoke out of your face will be sufficient for hobby work-You're not doing it 40 hours a week! Don't point the fan directly at your iron stand, though. It might blow hard enough to cool your iron off, and you'll be frustrated.
Step 4: Cleanliness is Essential, Part 1
Soldering is a process somewhat like gluing, in that the solder has to form a tight bond between the parts. Just as clean parts glue better, they also solder better. Any mud, blood, beer, grease, oil, or especially oxidation will make the joint difficult or impossible to solder well.
How do you know it's clean enough? Clean it till it's shiny. Only bare metal will solder. Tin or Gold-plated circuit boards don't need to be cleaned unless you've been a slob and gotten crud on them, but bare Copper boards can always stand a quick buffing with fine steel wool. Anything else that looks old and gray needs some cleaning before you start to solder.
"Solder Aid" sets often include a small wire brush that's very helpful. Fiberglass "Scratch Brushes," used by jewelers, are even better.
Step 5: Cleanliness is Essential, Part 2
Your workpiece isn't the only thing that needs to be clean. So does your soldering iron. A dirty iron won't transfer it's heat to the work very well. That's why most iron stands include a sponge. Always make sure the sponge is wet (water only) before touching it with the iron.
You clean a soldering iron by wiping it on the sponge, then tinning it. This must be done very frequently because the solder on the tip oxidizes rapidly in the heat. "Tinning" is simply the process of coating something with solder. Your tip should look silver and shiny.
My routine is, every time I pick up the iron, I give it a quick wipe on the sponge, then tin. Now I've got a clean shiny tip for maximum efficiency. The extra little blob of solder on the tip conforms to the work, increasing heat transfer.
Important Note: Never clean your tip with steel wool or sandpaper, no matter the temptation. You'll remove the plating on the tip and it will wear out very fast. The solder will literally dissolve the tip!
Step 6: Don't Just Stand There, Solder Something!
Preliminaries out of the way, let's start soldering. The most important thing to understand about the soldering process is this: The purpose of the iron is to get the workpiece hot enough to melt the solder! Melting the solder on the iron and "dribbling" it on the work won't do at all. It just won't stick.
The proper technique is to apply the soldering iron to one side of the work, making sure it's contacting both parts to be joined. Both parts must be at soldering temperature. Then, apply the solder to the other side of the workpiece, not to the iron tip. It takes less time to do than it does to read this. After only a little practice, you can solder a PCB (Printed Circuit Board) connection in 3 to 5 seconds.
Most semiconductors are heat sensitive. Learn to solder quickly. (Another reason to use IC sockets.)
If soldering wires to wires, or wires to switches or other components, get a mechanically sound connection first. Twist wires together or wrap the wire around a terminal. If using multi-strand wire, it helps a lot to twist the end of the wire and apply a bit of solder to the wire first. Then it's easy to put a small "U" bend in the wire with your pliers and crimp that onto your terminal. Splice tiny wires, (for instance, adding long wires to an LED), by putting a "U" bend in each wire, then hooking them together and squeezing the connection down. Now they'll stay put while you solder.
Step 7: Problems and Rework
How does your solder joint look? If it's smooth and shiny, and you can't see any gap between either part and the solder, it's probably good. A good PCB joint should be shaped something like a Hershey's Kiss.
If the hole in the board isn't covered, or the joint looks dull and granular instead of smooth, reheat and add a little more solder.
If your PCB joint looks like a beach ball, you either didn't heat the pad and the wire, or you used too much solder. Try cautiously reheating and adding a tiny bit more solder. (You add more solder in this case for the flux.) If the solder is stuck to both the wire and pad, leave it alone and use less solder next time.
Solder Wick is available from the places you buy solder, and is great for soaking up excess solder if you've used too much.
If your project is a PCB, inspect it carefully, using a magnifier if necessary, for solder "Bridges." These are most likely between IC pins. It's helpful to have a diagram of what the board is supposed to look like. If you find any bridges, reheat and scrape off the excess solder with a small tool or the iron tip itself, or use solder wick and then resolder.
Step 8: Going Further
This information covers simple hobby soldering.
Surface Mount Devices (SMDs) can be hand soldered, also, and once you know the basics of soldering, it's not too hard. You just need a finer tip iron and a steady hand (and maybe a magnifier). The best way to solder surface mount stuff is to tin the PCB pads first with a film of solder. Then with the part in tweezers in one hand and the iron in the other, re-melt the solder on one pad and place the part into the melted solder. Hold it there till the solder solidifies. Now, go back to the other pad(s) and add a little solder to each one until all are done. Go back to the pad you started with and reheat it a bit to make sure it's good.
Other methods include the use of solder paste, but that's a subject for another day. Now get out there and solder something! Practice does make perfect.