How does the game loop actually work?

Thanks, I run into engine errors and question my code, now I see how to conduct a proper work flow.