system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do fighter jets know when they're being locked on to?
gpt
Lock on for radar guided missiles involves, well, radar. If you are having radar beamed at you, that can be detected. Fighters have radar warning recievers that let the pilot know if they are being "painted" and by what type of targeting radar, as different models have different characteristics. 

Infrared guided missiles (heat seeking) are much trickier though, because they don't emit anything. For those, you need luck and a good visual system, either via your eyes or an automatic camera based system.