Changing the passcode is easy: go into the Settings screen and tap on the Passcode area. Enter your current passcode and then select Change Passcode. Type in your new passcode (twice!) and you’re all set.
If you’ve forgotten your passcode, you will be taken to the login screen after your third incorrect attempt, at which point you’ll have to log in again with your username and password. The passcode will be turned off, allowing you to set a new one.