There is a great program called
Carbon Copy Cloner which can Duplicate the original Drive. Get an External FIREWIRE Enclosure for the New Drive you buy. Put the NEW drive in it & hook it up to the Macbook and use
Carbon Copy to create an exact duplicate of the original. When you swap out the drives the replacement will work just like the original. And you'll have an enclosure for the "old" drive as backup.
OR
If you cant do that and you want to do a Clean install this is how:
Install the new Hard Drive. Then Boot off the Grey OSX Restor cd by putting the cd in and holding the "C" key at startup. Before you install anything you will have to initialize the drive. In the top menu there there is a Utilities Menu - Open Disk untility from it and erase the drive and intialize it as Mac OS Extended(Journaled). Then you can install OSX on it.