Hey there H_J_M,
Thanks for contacting the Apple Support Community today. If backing up your iPhone to your iMac, you would need to use Finder or iTunes depending on the macOS version you're working with.
For steps on backing up your iPhone, check out the steps below:
Back up with the Finder
1. On a Mac with macOS Catalina or later, open a Finder window.
2. Connect your device to your computer with a USB cable.
3. If asked for your device passcode or to Trust This Computer, follow the onscreen steps. Get help if you forgot your passcode.
4. Select your device on your computer. Learn what to do if your device doesn't appear on your computer.
5. If you want to save Health and Activity data from your device or Apple Watch, you need to encrypt your backup. Select the "Encrypt local backup" checkbox and create a memorable password.
Save your password somewhere safe, because there's no way to recover your backups without this password.
6. Click Back Up Now.
7. When the process ends, you can see if the backup finished successfully. You'll see the date and time of your last backup.
Back up with iTunes
1. On a Mac with macOS Mojave or earlier, open iTunes.
2. Connect your device to your computer with a USB cable.
3. If asked for your device passcode or to Trust This Computer, follow the onscreen steps. Get help if you forgot your passcode.
4. Select your device on your computer. Learn what to do if your device doesn't appear on your computer.
5. If you want to save Health and Activity data from your device or Apple Watch, you need to encrypt your backup. Select the "Encrypt [device] backup" checkbox and create a memorable password.
Save your password somewhere safe, because there's no way to recover your backups without this password.
6. Click Back Up Now.
7. When the process ends, you can see if the backup finished successfully. You'll see the date and time of your last backup.
For more details, check out this link here: How to back up your iPhone, iPad, and iPod touch with your Mac - Apple Support
We hope that's able to help.
Have a great day!