Do you want to clear all the settings on your phone and restore it to a factory state? Or do you mean that you need to clear some storage space on your phone? A little more detail would help.
To free up RAM and close any programs running in the background manually (as opposed to letting the system do it automatically) press and hold the back button. Scroll through the card view on any open programs and tap the X in the upper right corner of the card.