Generally coaches call timeouts at the end of the halves, not quarters. At the end of the first half the timeouts reset so they may as well use them (and unused timeouts are useless after the game ends.)
These timeouts give the coaches a chance to carefully choose their next play after getting a sneak peak at what the other team had planned. They can also be used to mess up the timing of the other team.
But most importantly, a timeout stops the game clock. A team that is winning and has the ball can waste time by letting the play clock and game clock run (games end after game clock time runs out.) A timeout stops the game clock, preventing the winning team with the ball from wasting time, so the losing team can try to have more time to score.
Conversely, the winning team who has the ball may let the game and play clock run as low as possible then call a time out at the last second. This lets the winning team waste as much time as possible, without taking too many penalties for delay of game. Even though they are winning and just trying to waste time to speed up the end of the game, the team probably doesn’t want penalties because if they can get a first down, they can waste even more time and probably just win the game outright.
Latest Answers