Different airlines have different rules about flying with an infant. Some airlines allow a baby to fly when they're 2 days old. Others require babies to be at least 2 weeks old before flying. If you've recently had a cesarean section, some airlines will require a doctor's note after your 6-week checkup stating that you're fit to fly. It's a good idea to consult with your pediatrician and get their go-ahead before buying the tickets.
Make sure to call the airline and check their requirements before you buy a ticket. Once you have your ticket, you can make seating arrangements for your baby with the airline. Some airlines offer in-flight cots during long-haul flights, and others allow you to bring your baby's car seat with you.
For their first few years, your baby isn't old enough to fly in a regular airplane seat. For shorter flights, babies under 2 years old can sit on an adult's lap, and you don't have to buy them their own ticket. If you're going to place them in a car seat, they will need their own ticket.