Flares in Ace Combat 7: Skies Unknown are one of the most effective ways to avoid hitting with a rocket. And in fact, main premise of the game is to fire a set of flares from the plane. Their high temperature means that a self-starting infrared rocket mistakenly takes the heat of the flare for the heat emitted from the aircraft's engine and explodes at a safe distance from the machine.
In Ace Combat 7: Skies Unknown flares are thrown out with the default G key or by pressing both knobs on the joypad at the same time. It's worth changing this joypad layout in the options, because in the battle it's not a very convenient solution.
A flare will only be effective if it is fired at the right time when the rocket is approaching you. When you hear a "slow pick-up" alarm, wait. The enemy radar is just tracking you. When the sound signal is very fast and the voice repeats the command "Missile - evade" - then let the flares out. Use them with your head and in the final situation, because you have only 4 or 5 sets in reserve.