Formatting the new hard drive is the easy part. Opening up your iMac to remove and replace the drive is the hard part. Hopefully, you're prepared to do the swap with the proper tools.
There are several ways to prepare your new hard drive. You can use cloning software to copy everything from your old drive to the new one and then just swap them out. Download Carbon Copy Cloner from
here. It's free (donation ware) to use.
Another way is to use Time Machine to backup your internal drive (you will need another external drive), put the new drive in the iMac, boot the iMac with your install DVD, use Disk Utility to format it and install OS X. During the install, you'll be asked if you wish to restore from Time Machine backup. Attach the external drive with the backup on it and click yes.
Your new hard drive will be restored with everything from your old drive. This method is actually preferred since it will avoid any slowdowns inherited with the cloning process.