lots of laptops have trouble overheating when playing games or doing other tasks.
things which can help: lowering demands on the computer, e.g. reducing animations, particles, frames per second
ensuring proper ventilation: your laptop should sit on a hard flat surface, such as a table or desk, which permits airflow on all sides of it. pillows, blankets, or indeed your lap prevent proper cooling (also laptops on laps can slow-cook your legs, decidedly unhealthy)
optionally have an actively ventilated surface for it: i've got a thingy, lapdesk or suchlike, which includes 2 fans run from the usb plug. it gives me a few crucial degrees extra cooling
turn off any and all other applications running on your laptop, including things which you always have running in the background and forget about
beyond that there isn't very much you can do. small laptops like the macbook air are not really designed for processor intensive applications like 3d games, the air in particular is prone to becoming quite hot.