If you have forgotten the passcode(s) for your iPad and iPhone.....they cannot be currently "unlocked" as you state.....because the passcode is needed to unlock the phone.
The message on the screen of your devices likely reads "Unavailable" or "Security Locked".
Unfortunately, you cannot "reset" the passcode unless the phone is already unlocked.....which requires the correct entry of the passcode for the device......so you will have to reset / erase the iPad and iPhone and then set them up again. There are no "shortcuts" or "workarounds" here.
If you have current backups of the devices, you can use the backup to restore the phone during the new set up.
If you forgot your iPad passcode