Hello! We can start by identifying what the ideal gas law is. I like to think of it as the magic formula that describes gases: PV=nRT. This describes the relationship between pressure, temperature, volume, and the number of moles. R is the gas constant. So looking at this relationships, we can see that the pressure will increase if the temperature and/or number of moles increases and will decrease if the volume increases.
Lets think of a balloon filled with air. A half inflated balloon, one with less moles of oxygen will be flaccid. It won't feel filled as the pressure inside is very low. As I continue to inflate the balloon and increase the number of moles of oxygen, you see the pressure inside the balloon go up as it looks like it will eventually burst.
So using that idea, lets think of your lungs. We need oxygen to breath. The way our lungs work is when the lungs contract, the volume increases, which in turn decreases the pressure. When the pressure inside your lung decreases, oxygen from the atmosphere will move into your lungs (moves from high pressure to low pressure). We understand that relationship (volume increasing, pressure decreasing) from the ideal gas law.
Let's apply that to changes in altitude. When you go higher in altitude, say, on top of a mountain, the pressure of oxygen decreases. Now, we know that the pressure of oxygen in the atmosphere is low at high altitudes, and we need oxygen to enter our lungs. So when my lungs contract and decrease the pressure, it is difficult for oxygen to move from the atmosphere into our lungs because the pressure outside is so low (due to the high altitude).
I hope this helps! Let me know if you have any questions. Best of luck studying.