For security reasons, there is no way to recover lost PIN codes, passphrases, or lock codes. However, you can reset the app, and set it up again. Please note: Unless you have a backup, you will lose your Threema ID and all saved messages. (If you don’t remember your backup’s password, it cannot be recovered.)
Android: Delete the app data in Settings > Apps > Threema > Clear data.
iOS: Enter a wrong code ten times. A button will appear that allows you to reset the app data.