A clean install is a great thing to do to your mac computer , especially if you have just installed / updated one operating system on top of another , such as a move to Yosemite
First backup by using Time Machine : Time Machine Guide
Make sure you can access your backup !
Collect your programs if you need to reinstall them
Make sure you know your Apple ID and password
Erase the hard drive and reinstall the operating system : Format Guide
Check for updates at the App store ( sign in )
Open Migration Assistant from Utilities and recover your system : Recover Guide