How to know if someone switched tabs

i’ve seen on plenty amount of games, when switching tabs, something happens, are they just checking if alt + tab is pressed or is there a function/event for this?

You can use WindowFocused and WindowFocusReleased. I wouldn’t recommend checking alt+tab specifically since someone can just click minimize (or click the other window).