Replacing a spoke is easy. It’s often getting hold of the right length that’s the hard part!
First off, you need to buy a replacement spoke. Most local bike shops will stock a variety of lengths, so they're your best bet if you're unsure. If you know what length you need already, you'll undoubtedly know where to get them from.
Thread the new spoke through the hole in the hub and position it toward the gap it belong in the rim.
When the spoke tilts in one direction, others tilt in the opposite direction, meaning they cross over. The number of crossings depends entirely on the wheel. What's important is the LAST crossing.if the spoke being replaced is an outside spoke, it needs to pass the inside of the last spoke it crosses, and vice versa. Don't worry TOO much about bending the spoke. It'll be getting tightened in a minute anyway which will straighten it out - just try to keep the bend gentle, rather than a kink.
With the spoke laced through the others, and in the right place, start threading the nipple on to it from the other side of the rim.
Spin the wheel, and look at it carefully. If the rim kicks away from the the broken spoke, it's not tight enough. If it sweeps toward it, it's too tight. Keep tightening the nipple until the spoke is a similar tension to the surrounding spokes, and the wheel is true.