The Bible says that God brought to Noah all air-breathing land animals (Genesis 6:17, 7:15). Some insects, like butterflies, don’t really “breathe” air out of a mouth or nose. Air enters their bodies through tiny air holes in their bodies. So butterflies may not have been on the Ark.
But how would they have survived the global Flood if they weren’t on the Ark?
Some insects were probably stowaways, “sneaking” on board the Ark with the other animals, supplies, and food.
Insects could have survived outside the Ark on the floating trees and plants that must have covered the ocean during the Flood.