If you don’t use Apple Music it can be infuriating when it keeps opening when you press the media control keys on your Mac keyboard or the play/pause button on your Airpods. Spotify users will know all about this. If you want to stop this from happening, open up a terminal window and enter:
Zsh
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2>/dev/null
Problem solved!