If you want to remove your Apple ID from the phone and iPad that you'll be leaving behind, but still want to be able to access iCloud, you can do so by signing out of your Apple ID on those devices and signing in with a different Apple ID.
To sign out of your Apple ID on an iOS device, follow these steps:
- Go to the Settings app on your device.
- Tap on your name at the top of the screen.
- Tap "Sign Out."
- Enter your Apple ID password when prompted.
- Tap "Turn Off" to confirm that you want to sign out.
After signing out, you can then sign in with a different Apple ID if you'd like, or you can leave the device signed out if you don't want to use an Apple ID on it.
I hope this information is helpful. If you have any other questions, please don't hesitate to ask.