Do you mean reformat/restore to factory settings? If that's what you mean, simply go to Settings --> Backup & reset --> Factory data reset.
Make sure you have backup of your files before doing so.