On an iPhone, Media Volume, Alarm Volume, Alert/Ringer Volume, and Call Volume are related but not all controlled by the same setting.
1. Media Volume
This controls the sound produced by apps and media, such as:
YouTube and other videos
Music
Games
Podcasts
Most app sounds
Audio played through the iPhone speaker, headphones, CarPlay, Bluetooth, etc.
How to control it:
Press the Volume Up/Down buttons while media is playing, or
Open Control Center and move the volume slider.
The volume buttons normally control media volume when you are actively playing media.
2. Ringer / Alert Volume
This controls sounds such as:
Incoming phone calls
Text/message notifications
Mail notifications
App notification sounds
Calendar/reminder alerts
Other system alert sounds
Go to: Settings → Sounds & Haptics → Ringtone and Alerts
The Ringtone and Alerts slider controls this group of sounds.
You can also enable Change with Buttons. When enabled, the physical volume buttons can change the ringtone/alert volume when you're not actively controlling media.
Important: Turning media volume down to zero does not necessarily turn notification/ringer volume down to zero.
3. Alarm Volume
This is where there is an important distinction.
For Apple's Clock app alarms, the alarm volume is generally tied to the Ringtone and Alerts volume.
So if you set:
Settings → Sounds & Haptics → Ringtone and Alerts → 50%
your normal Clock alarm will use that level.
Changing the volume of a YouTube video, for example, doesn't change the Clock alarm volume.
Also, the Silent Mode switch does not silence a normal Clock alarm. That's intentional—otherwise it would be rather easy to sleep through an alarm.
4. Call Volume
There are actually two different "call volumes."
A. Volume of the person you're talking to
During a phone call, the side volume buttons control the volume of the other person's voice coming through the earpiece or speaker.
This is separate from your normal media volume.
For example:
You are listening to YouTube → volume at 70%
You make a phone call → you set call volume to 40%
Changing the call volume doesn't necessarily change your YouTube volume.
B. Ringtone volume
Before you answer a call, the incoming ringtone uses the Ringtone and Alerts volume described above.
Once you answer, the volume buttons control the call audio.
One particularly important iPhone setting
Go to: Settings → Sounds & Haptics → Ringtone and Alerts
You'll see the Ringtone and Alerts slider.
Below/around it you'll also find Change with Buttons.
If Change with Buttons is OFF, the physical volume buttons generally won't accidentally change your ringtone/alert volume when you're not playing media.
If Change with Buttons is ON, pressing the volume buttons when you're not actively playing media can change the ringtone/alert level.
So, if you want your alarm and notifications to remain at a fixed level, while freely using the side buttons for YouTube/music, keeping Change with Buttons OFF is usually the better arrangement.