Sign out of the one account if necessary; sign in with the other one.
Read this document to learn how to sign out of iCloud on your iPhone, iPad, iPod touch, Apple TV, or Mac --> Sign out of iCloud on your iPhone, iPad, iPod touch, Apple TV, or Mac - Apple Support
For an Apple mobile device:
1. Go to Settings, then tap your name.
2. Scroll down to the bottom.
3. Tap Sign Out.
4. Enter your Apple ID password and tap Turn Off. (Read this if you If you forgot your Apple ID password - Apple Support )
5. Turn on the data that you want to keep a copy of on your device.
6. Tap Sign Out.
7. Tap Sign Out again to confirm that you want to sign out of iCloud.
Read this support article to learn how to sign in with your Apple ID on different devices--> Sign in with your Apple ID - Apple Support
For an Apple Mobile device:
1. Open the Settings app.
2. Tap Sign in to your [device].
3. Enter your Apple ID and password.
4. If prompted, enter the six-digit verification code sent to your trusted device or phone number and complete sign in.
If another Apple ID is signed in you may need to enter the password for that ID to sign out of that ID first.
Note that when you sign in with the second ID, it will ask you if you wish to merge content between the two IDs. If you do not wish to do that, erase the iPad first.