The critical steps to a soldered plumbing joint that will not leak are:
Scrape the two surfaces clean with steel wool or a soldering brush;
Liberally apply flux to prevent oxidation of the surfaces to be soldered and choose your flux to match your solder, i.e. lead free;
Heat the joint on one side while applying the solder to the other side to be sure that the pipe melts the solder, not the flame.
Another tip I mentioned is when you are working on existing plumbing and despite all your efforts there is a little drip of water coming through the pipe that prevents you from getting it hot enough to melt the solder properly. Use a plastic tube to suck out as much of the water as possible, then jam white bread (no crust, no grains) down the pipe against the water. That will make a very short term plug which should give you just enough time to get the joint soldered. Then you can flush the bread through the whole system, even through the faucet. If it seems to be giving you problems, just wait a few minutes and try again as the bread dissolves in the water. By the way, don't try substituting toilet paper for bread. Believe it or not, toilet paper does not dissolve -- and you will have to cut the pipe open again to get your plug out. Yes, I did learn that the hard way.