Clearing contents of my iPad
You can remove all settings and information from your iPhone, iPad, or iPod touch using "Erase All Content and Settings" in Settings > General > Reset.

From Apple's site.

edit:sorens is correct. The answer to the first part of your question is by default every time you sync with iTunes it backs up your iOS device. So just sync and reset.