A good solder joint requires heating both surfaces to re-melt a pre-tinned layer of solder, not dropping molten solder onto cold metal
Soldering is not melting solder onto a joint from above. The correct technique is: (1) tin both surfaces separately by heating each with the iron and applying solder until it flows around and coats smoothly; (2) touch the tinned surfaces together and reheat both simultaneously until the two solder layers flow together into a single shiny joint. A cold solder joint—caused by insufficient heat or wiggling before cool—appears grey and rough, conducts poorly, and fails under vibration. The iron tip must be clean and tinned (shiny with solder), regularly wiped on a damp sponge. Rosin-core solder (not acid-core, which is for plumbing) is required. Fine-tipped 25-60W irons work best for electronics; soldering guns are too large and imprecise.
Examples
Tin two wire ends separately. Twist them together. Touch iron to the joint (not to the solder roll) and apply solder until it flows smoothly through the junction. Remove iron, do not move for several seconds. Shiny result = success; grey/lumpy = reheat.
Assessment
What does a cold solder joint look like, and what causes it? Why should you apply solder to the wire rather than to the iron tip during tinning?