See Sign in to your Apple Account in Music on Mac - Apple Support:
Sign out of your Apple Account in the Music app
You might want to sign out of your Apple Account to let another user sign in to their account, essentially switching between users.
- Go to the Music app
on your Mac. - Choose Account > Sign Out.
Note that using the Apple Music subscription service or downloading past purchases associates the computer or the device with that Apple ID, which then prevents switching to another ID for 90 days. See Authorization vs. association - Apple Community for background.
tt2