You can sign out of the account on the phone and sign in with the one on the Mac. You can use the same one on both at the same time.
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
Click on this link to learn how to 'Sign in with your Apple ID' --> Sign in with your Apple ID - Apple Support
The 'already taken' message sounds to me like you are trying to create a new ID, not sign in with one that already exists.
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.
What is not so easy is if you wish to gerge content. Merging Apple accounts (IDs) or transferring data is not officially supported, nor can it be done easily or completely. Read the links below for things you may need to do to transfer as much as is possible.
Apps and media bought with one ID are permanently associated with that ID. Look into using Family Sharing to continue to be able to use items purchased with one Apple ID with other Apple IDs.
- Family Sharing - What is Family Sharing? - Apple Support
- Set up Family Sharing - Set up Family Sharing - Apple Support
Share folders with iCloud Drive --> Share files and folders in iCloud Drive on iCloud.com - Apple Support
Read How to use Shared Albums in Photos on your iPhone, iPad, and Mac - Apple Support about about how to share photos.
If you have signed into the first ID on a device then fortunately when you sign out of that ID, do not erase the device, then sign in with a different ID, it asks you in most cases if you wish to merge the data from the two IDs on your device. Say yes and later delete individual items from the other ID that you do not want. Note, in How to save apps and progress on one Appl… - Apple Community a Community Specialist says, "you will not be able to transfer the meta data from one Apple ID to another. Once you switch to another Apple ID the information associated with the old Apple ID will be gone except for physical content on the device like photos and videos."
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
If another Apple ID is signed in you may need to enter the password for that ID to sign out of that ID first.
Click on this link to learn how to 'Sign in with your Apple ID' --> Sign in with your Apple ID - Apple Support
Additional contributor posts:
- Apr. 2018 post by ASC helper Winston Churchill on transferring data from one Apple ID to another. Can I merge two iCloud accounts - Apple Community
- Feb. 2021 tips from Eric Root Apple ID - Apple Community