Try to reset the SMC and the PRAM
SMC RESET
Shut down the computer.
Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
Release all the keys and the power button at the same time.
Press the power button to turn on the computer.
PRAM RESET
Shut down the computer.
Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step
Turn on the computer.
Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
Hold the keys down until the computer restarts and you hear the startup sound for the second time.
Release the keys.
command = the cmd key
option is the alt key
if this did not work try installing SMCfancontrol and set the setting to default
if this didn't work try replacing the heatsink (do not forget to replace thermal paste)
the part costs $14,95 MacBook Air 13" (Mid 2013-2017) Heat Sink
do at own risk
if this didn't work the MacBook might just be fried