Here are some helpful ways to stop the pipe from leaking. That’s how the plumbers also do it.
You can stop the leaking by doing all the steps, every time. Get sloppy and most joints don’t leak, most of the time. But to have only 1/500 leak instead of 1/50 requires working more carefully. It takes more time. But you waste less time fixing your errors.
For copper hydraulic hose fittings: sand and brush both fitting and pipe. Apply a thin film of flux to each. Heat the fitting, not the pipe. Wipe your joints after the solder has solidified but while it’s still over 100C so your wet rags sizzle.
For PVC: Prime both fitting and pipe. Use the paste to both fitting and pipe. Twist it at 90-degree.
For thread galv and black iron, stay away from the most affordable Chinese fittings. Learn how many threads should be on a hydraulic hose or nipple - one left on the threading machine too long will never seal right. It’s messier than Teflon tape, it’s more versatile and reliable. Scale the torque you apply to the size of the pipe. Don’t apply the same force to a 2″ pipe as to a 1/2″ pipe. If something didn’t feel right be willing to throw away the last few pieces and do them again.
If it didn’t feel right, it probably wasn’t right. If the solder didn’t flow normally, or a threaded joint felt different, maybe the part was just wrong - out of spec, out of round, or something. Toss it and start again.