Generally, all insects have four wings, but they are not always used for flying.
Flies in particular are also among the best flyers, and yet, they use only two of their wings for flying, the other two shrank to became halteres, a sensory organ acting like a gyroscope.
Dragonflies may be the best fliers in the insect world thanks to their four independently controlled wings, but flies may be the second best, and they achieved that by losing two of their four wings. Evolution is interesting.