When you connect your iPhone to your Mac, you can change the settings in the window for the iPhone to backup only when you manually tell it to, versus automatically.
The location of the backup of the iPhone is in your USER Library folder => Application Support folder => Mobilesync folder.
There is no setting to change the location of that folder where the backups go. It is hardwired.
Some users have used Terminal to create special links to try to shift that location to an external drive to save space, but unless you are savvy about Terminal commands and are willing to update that as the operating system gets updated (as Apple could change the way devices get backed up in the future), that might not be the best solution for you.
One thing you can do is move the contents of that Mobilesync to an external drive that is formatted HFS+ and GUID (the normal Apple file format). After verifying that the folder contents have been moved successfully, you can delete those backup files from your Mac. To restore your iPhone from a backup, you would need to move the backup file back to your Mac to the excite same location, so you might need to shift other files off the Mac to enable that, should a restore be necessary.
The automatic downloads to your Mac or iPhone when another device on your account has downloaded something is managed through settings. In the Apple Music application, open Preferences and you will see checkboxes to uncheck to stop those automatic downloads. If you have an older Mac using iTunes, it is in Preferences => Downloads setting. On the iPhone you can stop it from the App Store through the Settings => App Store turn off Automatic Downloads. On the iPhone Settings for Music you can turn off Automatic Downloads. there also.
You can really save space for your iPhone backups by backing it up to iCloud. Then you can stop doing backups physically to your Mac entirely. That iCloud backup can be used to restore an iPhone or transfer to a new iPhone when you change iPhones in the future. There may be a small charge (a few dollars per month) for this depending on how large your backups are and how much iCloud storage you need, but it is worth it and generally cheaper than paying someone to replace the internal drive of your Mac to something bigger.