I was wondering how people time frames in games, I wanna know in case I get interested in speedrunning a game with glitches which require me to do an action on certain frames
For learning a specific glitch, you’ll likely get better advice asking people who run that specific game.
Ok cool but I want to know how to to time frames for games in general so it's easier doing frame glitches in any game.
Depending on the framerate the game is running on, the timing for frames will vary (30 FPS = 1/30th of a second per frame //60 FPS = 1/60th of a second per frame).
Now, if what you really mean is how people manage to pull off "frame-perfect" skips/glitches, that's a skill that is mostly developed by trial and error, getting a feel for the technique and timing, and aside from that vague description there's no "end-all-be-all" approach to it. Just gotta practice outside of runs 'til you're at least semi-consistent.