one can’t explain that in general, it just depends on what game or app you want to code, but there are many ways for it ( maybe start with a simple function to detect whether a point is inside a polygon )

this is some sample code from one of my glprograms
you basically make a small clip plane and when you move this clip plane(bullet, car, ect…)if something is going to be rendered inside this clip plane(polygon,wall,ect…)it is reported as a collision!