Firstly, I'm not an auto electrician. So if you find any faults with my how-to don't be afraid to correct me.
But this is how I did it on my 91 Suzuki Vitara and haven't had any dramas since.
Ok, a faulty alternator is very often misdiagnosed.
Symptoms:
Battery warning light on
Dimming headlights and electronics
Trouble starting, or
Flat battery
If you experience any of these, here is how to test if it's your alternator:
1. With the car turned off and all electronics off, measure the voltage of the battery.
If battery is completely flat (ie engine won't turn over) charge it over night and repeat step 1.
2. Start the car and measure voltage with the engine running.
If the voltage doesn't increase when the engine is running then your alternator isn't charging your battery.
So, provided there isn't a wiring problem and your alternator belt is shot, it's probably your alternator.
What you'll need:
Spanner set and/or
Socket set
Screwdrivers, various
Torch, recommended
Beer, recommended
Dog, recommended
Step 1.

Disconnect battery! Before you even think about doing anything else, do this first.
Step 2.

Locate your alternator and take off the belt by unscrewing the bolt circled in red.
Step 3.

At the back of the alternator there are some cables that need to be unplugged. Mine had locking clips that need to be pressed down while pulling. A flat head screwdriver is handy to depress the clips while jimmying the plug out. Be gentle however, as there is a rubber o-ring on the plug that you must not damage.

Behind that is an earth cable. Undo the nut and it slides off. Once the cables are off, tuck them out of the way
Step 4.

Slide under the car and undo the two bolts circled in red. These are the only things holding the alternator now, so make sure that its weight is supported when you take them out.
Now if you're lucky, you can maneuver it straight out. But you may need to move some bits and pieces to make room.
Now feed the prick to your dog

Step 5.
Unwrap your shiny new (expensive


Slide it in place just how the old one was and screw the bolts underneath back in.
Step 6.

Now is a very good time to change your alternator belt. So take off the old one and put it under your spare wheel for an emergency because its still probably ok. Put the new one on and slip it over the alternator pulley.
Using a screwdriver as a lever, put tension on the belt as you screw the bolt back in behind the arm. Use as much force as you can when tensioning, just don't bend your screwdriver.
Step 7.

Put a tiny bit of lube on the o-ring and reconnect the plug and earth wire.
Now stop and think. Make sure everything is back how it was, anything you moved out the way is back in place, all your tools are out of the engine bay, etc
Step 8.

Reconnect battery.
Now repeat the alternator check at the top of the article. Your voltage should now jump to a healthy 14v (ish) when you start the car. Take it for a quick test drive and test high beams etc.

Admire your handiwork and crack a beer.
Hope this article has been helpful and feel free to comment. Cheers.