Flux is a chemical compound that makes soldering much easier. Flux serves two purposes, cleaning oxides and other impurities from metal surfaces and helping the solder to flow. What flux is made of varies depending on the purpose.
Frequently you can tell what flux is made of from the color. If it’s white, it’s probably acidic and meant for plumbing, and if it’s a weird shade of amber, it’s made of rosin and suitable for electronics.
The composition of solder flux
The exact formulation can vary. Plumbing flux generally contains an acid, such as ammonium chloride, zinc chloride, or even Hydrochloric acid, in a petroleum-based carrier. Electrical flux is designed expressly to be less corrosive than plumbing flux. There are also different formulations for electrical soldering. The exact formulations are often trade secrets, but you can make a simple rosin flux for electrical or electronics work by soaking pine cones in denatured alcohol for 8-24 hours and then straining it a couple of times with a coffee filter.
As a baseball fan, I always found the terminology curious. Baseball players use rosin to get a better grip on the baseball or the bat. It seems like the last thing you’d want to smear on copper to remove impurities and make molten solder flow better to get a good solder joint between electronic components. But it works. And it really is rosin, as in pine trees. Not resin, as in 3D printing. Resin seems like a better match for electronics, but not in this case.
I’d never really thought about what flux residue looks like. I’d also never thought about what overcooked pine tar or tree sap would look like. But the leftover flux residue after soldering looks a lot like what I would imagine overcooked pine tar would look like. And that’s not a coincidence, because that’s pretty much what flux residue is.
Solder flux residue
Solder flux residue needs to be cleaned off after the work is complete, or it can corrode and weaken the joint over time. While using tree sap as a cleaner sounds counter-intuitive, it does make sense that it’s not something you want to leave on a printed circuit board long term. At least to me it does, but I’m a little strange.
You can also get a variety called no clean flux, which goes chemically inert after you use, although it can still discolor the area and look bad. Some hobbyists and technicians go ahead and clean off even no-clean flux, to make their work look neater, but it isn’t strictly necessary.
It is very difficult, if not impossible, to distinguish between leftover regular flux and the no-clean variety, so when working on an old PCB, many technicians will clean off any old flux they find and then re-flow the joints. It ensures they don’t have any corrosive residues interfering with the bond.
The type of flux matters more than the composition
The exact formulation doesn’t matter as much as ensuring you are using the right type of flux. You can usually tell the difference from the color. If it’s white in color, it’s probably for plumbing. Don’t use that for electrical or electronics work. If it’s a dark amber color, that’s for electrical and electronics work. It can be hard to get suitable solder at a home improvement store, which is one reason I miss Radio Shack. But I digress.
Of course as a general rule, flux that you get from a well-known electronics distributor will tend to be better quality than the cheapest stuff you find on Ali Express. Whether you use liquid or paste flux is entirely up to you. Some people find liquid easier to work with. Others find paste easier. You can even get a flux pen for really fine control if you need it.
Cleaning off the residue when finished
For hobby work, you can save yourself some grief by using no-clean flux. It does cost more, but it will save you time, so if you don’t use a lot of it, you probably won’t notice the price difference very much. If you do use a lot of it, the value of your time troubleshooting old work is something you need to consider. I think it’s worth it.
Almost any solvent can remove flux after you are done. Isopropyl alcohol is the most common choice. If for some reason you don’t have any on hand, contact cleaner will also remove flux, as will mineral spirits. Mineral spirits is the active ingredient in contact cleaner.
The manufacturer probably used an ultrasonic cleaner to remove any residue left over from the soldering process. But after hand soldering a spot repair, application of alcohol followed up with a scrub from an old toothbrush and sopping up what’s left with a paper towel is fine.