Lots of good advice here for you. Don't mean to insult you if this gets too basic . . . Hard to tell your experience level . . . Getting the old pipe "copery clean" is essential. Also, buy the best grade of flux you can find. Cheap flux is all but worthless. Use a fresh brush.
Remember to heat where you want the solder to "go" . . . it follows heat. Get all around the valve, not just where you can see. DO NOT overfill the top of the valve so you do not run solder down into the ball. Use just enough to get a good seal.
Sweating copper is about the feel as much as technique. Here is a YouTube location you can review in advance: