First, use a passcode that's easy to remember. Secondly, you can use the iCloud keychain to sync your passcodes to save you from having to remember them.  iCloud keychain is a service provided by Apple to create, save, and sync your passcodes.