A flyby is when a spacecraft goes close to a planet or other celestial body but doesn't go into orbit around it. Imagine you're on a bike and you ride past a park without stopping to play, that's like a flyby.
When a spacecraft goes on a flyby, it can take pictures and collect information about the planet or moon it's passing. It can also use the planet's gravity to help it speed up, slow down, or change direction. It's like getting a little bit of help from your friend who is playing catch with you and tossing a ball your way to help you move faster.
Scientists use flybys to learn more about the planets in our solar system and to figure out where might be good places to explore next. It's like when you go on a trip and you drive through a town quickly, you get a little glimpse of what it looks like and decide if it's a place you want to come back and visit more.