On the AirPods 4 and on AirPods Pro models, you can switch between Active Noise Cancellation and Transparency mode, which lets ambient noise in, by pressing and holding the force sensor on the stem of your left or right earbud. If you pinch the stem of your AirPods in the front and back, you'll feel it click. That's when the Listening Mode switches. This mode-switching feature is on by default, but you can change it by going to the Settings app on your iPhone, iPad or Mac computer, then into the section that says [name] AirPods or AirPods Pro. Take note that you must be using your AirPods or at least have their charging case open to be able to access this control center.
In the device's settings menu, scroll down to Press and Hold AirPods, where you'll be able to customize Listening Mode for each earbud. You can choose to stick with Transparency and Noise Cancellation, but you can also select Adaptive mode, which automatically changes how much external noise you hear based on your surroundings.
There's also the "Off" option, which completely turns off advanced noise control features. If you choose more than two modes, your AirPods will cycle between all of them when you press and hold the stem of your earbud. Having a quick way to change Listening Modes can be very useful if you'd rather not take your iPhone out of your bag when you're out, for instance, and would like to be able to hear your surroundings in public for safety purposes.