Stereo wiring is actually pretty easy.
There are three wires that pertain to power. One is a constant 12V power wire that is connected, usually by way of a fuse, to the battery. This keeps power applied to the stereo when the ignition is off so that the clock settings, radio presets, etc., aren't lost. The other wire is used to provide 12V power to the unit when the ignition switch is on. The 12V power wires are usually red or orange on newer units. The third is a ground wire that grounds the unit to the chassis, and these are usually dark green or black.
Most of the rest of the wires are for the speakers. Most stereo units use a positive (+) and negative (-) wire for each speaker, and these can be identified because you'll see pairs of wires of the same color (purple, white, grey, light green are common) where one wire is a solid color and another is that color with white stripes. Usually the positive wire is solid and the negative has the stripe. If you look at your speakers you'll see a (+) or (-) sign on the connectors on the back, and you just run the right wire to the right speaker. You'll need a wiring diagram to tell which colors/wires go to which speakers. You can wire them up wrong and not know it until you adjust your balance (left/right) of fader (front/back) controls and the wrong speakers are playing.
A single, medium blue, wire is usually used to route power to a separate amplifier if you're using one.
Your factory stereo usually has a 12V ignition wire, a ground wire, and three or four speaker wires depending on how many speakers your car has. If you're going to replace the stereo you should also replace all of the speakers and install a nice 4-speaker system.