How do I delete my Apple ID, screen codes and/or reset my device?

For Apple devices:

Settings > iCloud > Find my iPhone > Disable
Return to iCloud settings and select Log Off on the bottom. You may need to enter the password.

Go back to Settings and tap General > Reset > Erase All Content and Settings.

For other devices:

Select Settings > Reset phone (or "Reset default settings" or "Restore factory settings" depending on the model).