Open a Finder window by clicking the Finder window in your dock.
Select Preferences from the Finder menu.
To hide Hard disks uncheck the Hard disks checkbox. Do the same to hide External disks, CDs, DVDs, and iPods, as well as Connected servers.
Press Command+w on the keyboard to close the preferences window.