More on mechanics
In the paragraphs below, see Sheldon's glossary to look up any unfamiliar words.
You buy your new spokes (with nipples) from the bike shop. Make sure you take your wheel with the broken spokes in so they can figure out the correct length.
Take off the tire and tube and rim tape. Look carefully at your wheel to see where the spoke should go. You have to figure out which hole in the hub the spoke goes into, which hole in the rim it goes into, and which side of the hub flange the head of the spoke (the flat part opposite the threads) should be on. This shouldn't be too hard to figure out, since wheels spokes are symmetrical. If your wheel is sufficiently bad, look at another wheel to figure out the pattern. One hint: the hole in the rim where the spokes go are offset a bit: alternate holes are more towards one side of the rim, then more towards the other side. Make sure that the rim hole you put the spoke into is closer to the side of the hub that you put the spoke into.
To put the spoke in, put it into the hub flange first (pay attention to how you insert it so you end up with the spoke head on the correct side). Now, look carefully at the way your wheel is put together, the lacing pattern used. Probably it will be a 32 or 36 spoke wheel, three cross pattern (this is most common nowadays), and thus there will be 8 or 9 groups of four spokes, with each group doing exactly the same thing. From looking at this, figure out what your replacement spoke should be doing as it goes from hub to rim.
Once you figure it out, do it. Weave your new spoke between the existing spokes, copying the pattern on the other spokes on the wheel (probably it will go over, over, under the spokes it crosses, or else under, under, over). Then put some grease on the threads of the spoke, put it into the right hole on the rim, then put the nipple in from the other side of the rim and tighten it up with a screwdriver. Then use a spoke wrench (if you have to buy one, the best reasonably priced one is called a Spokey, buy it from the shop where you get the spokes so you get one that matches your type of nipples) to tighten it up to about the same tension as the other spokes in the wheel (pluck the spokes to hear the note they make, and try to make your new spoke similar).
Now comes the hard part:truing. Follow Sheldon Brown's instructions.
If you don't have a truing stand, put the wheel on your bike and spin it around, comparing the distance from the rim to the brake blocks.
Well, that's how you replace a spoke.
BUT, you really shouldn't be breaking spokes in the first place. Probably your wheels were cheap and badly made. The way to get good wheels is to make them yourself. I'd take the wheel completely apart and start from stratch. You can replace parts at will when you do this. If your hub, rim, or spokes aren't as good as you like, change them. You should have double butted stainless steel spokes. The 2.0/1.8/2.0mm (also known as 14/15 gauge) are the most common and work fine. Then build the wheel as suggested by Sheldon Brown in his wheelbuilding article.