system
Given the following post, respond as if you're commenting on Reddit:
human
I can switch between breathing from my mouth, my nose, or both, even with both of my mouth and nose open. Anatomically and physiologically, how does this happen? Also, how does the body switch between the right and left nostrils?

Edit: Thank you for those who made helpful, scientific replies! There are too many of you for me to thank individually, so, thanks to all of you!
gpt
There's a flap of tissue near the end of the nasal passage that at least some people can voluntarily close. This helps, among other things, to prevent the water and food you swallow from ending up in your nasal passage. You can actually see it in a mirror with your mouth open: it's at the back and top of your throat.

Your respiratory and digestive systems actually have a few of these: another is what allows you to use the same hole to both breath and eat without letting the food in your lungs (usually).