This question has been asked and answered many times before here at Ask Different. The best I can do is post this answer and give links to other answers.
Updated Answer
In your comments, you referenced the inability to hear the sound from the MacBook air. This problem has also been addressed by the question "How can I play the sound from the audio in through my speakers?". Evidently, there was a noticeable delay when using many (if not all) of the solutions posted in the answers. This updated answer attempts to avoid digitally mixing the two audio signals.
I assume you already have analog line level output from both the Nintendo Switch and PS5. The devices mentioned in my original answer can provide analog line level output from the Mac. However, I believe the headphone output on your Mac could be substituted for an analog line level output, if the output level was set low enough. Below is an example of a powered headphone amplifier which can combine analog line level inputs and provide output to your earbuds.
Donner DEL-8i2 4-Channel Stereo Line Headphone Mixer


My Original Answer
You need to purchase a device that has line in ports and can plug into one of your Mac's existing USB-C ports. Many of the previous answers have referred to Behringer's line of USB audio interfaces. Three of the lower priced Mac compatible USB audio interfaces are given below. These are ordered by lowest list price first.
To use one of the above device, you will need the following:
- An adaptor to go from the device's USB-A jack to your Mac's USB-C port.
- An adaptor to go from the female 3.5mm port to the device's two RCA line in ports.
UCA202 Versus UCA222
The comparison below was taken from the article "Behringer UCA202 vs UCA222" by admin; published July 4, 2019 at Recordingbro.com.
"Physically, both of them are identical models with the latter being a newer model but, there is something that sets them apart and probably what most important when considering these interface. As an older model, UCA202 comes with a free and open source Audacity as well as Kreative’s Kristal Audio Engine. On the other hand, Behringer UCA222 is packed with those two but also added with EnergyXT2.5 or the Compact Behringer Edition as well as another disk with more than 100 virtual instruments and 50+ plug-ins."
Links