When jailbreaking an iPhone, iPod touch or iPad, the jailbreak program installs Cydia to your device. Cydia allows you to search for and install apps, tweaks and themes outside Apple's App Store. If you later want to delete Cydia and return to a non-jailbroken system, you can do so by restoring your device to its factory settings in iTunes. As long as you back up your device first, you won't lose any data during the process.
Attach your iPod touch, iPhone or iPad to your computer and open iTunes.
Click on your device in the sidebar, then press "Sync" and allow it to finish the backup.
Press the "Restore" button in the Summary window. If iTunes asks you if you want to back up first, pick "Don't Back Up," unless you were unable to sync properly before restoring, in which case pick "Back Up" instead.
Click "Restore" to confirm the process and wait while your device restores and reboots.
Pick the option to restore from a backup after your device finishes rebooting and reconnects to iTunes. Select the most recent backup from the drop-down menu and click "Continue" to transfer all your data back to the device. Because Cydia does not install through iTunes, it will not transfer back during the restore, effectively deleting the program permanently.
Even if you need to delete Cydia without opening it because it can't open properly, but want it reinstalled, restoring through iTunes then re-jailbreaking is still the safest method.
If your device doesn't have the newest version of iOS installed already, you can use the "Update" button instead of pressing "Restore." This will both update your system and remove Cydia.
Jailbreaking your iOS device will void its warranty.