This article explains how to prevent iTunes from automatically opening in macOS 10.11 through 10.14.6 when an iPhone 7 or later is connected to the computer.
Tutorial: Prevent iTunes from Opening Automatically on a Mac
If you don’t want iTunes to open automatically when you connect your iPhone to your computer, a few tweaks to the Preferences section of your iTunes app should fix the problem. Here’s how to make those changes:
Open iTunes by selecting its shortcut in the macOS Dock or via Launchpad.
Click iTunes > Preferences. You can also press Command+Comma (,)