If becoming an airline pilot is your career objective; learning to fly an actual airplane is not the most difficult part. The technical aspects of piloting an aircraft—even large, commercial jets—can be mastered by most anyone committed to doing so, but being put in charge of an airplane, its crew, and passengers, and its cargo is about more than just those technical aspects. Gaining the necessary experience requires a significant investment of time and money.
Aircraft technology has become so advanced that it's become a cliche for people to say airplanes fly themselves. And that can be true when everything is going according to plan, but everything doesn't always go according to plan. Airline pilots need to have the capacity to handle large aircraft and to make decisions with the best interests of all on board, and they need to be able to do so in adverse conditions. So, in addition to flight experience, a well-rounded education is important for prospective airline pilots.
Airlines also value pilots who have experience flying for the military and the leadership skills that often come with that.
Large, commercial airlines require pilots to have bachelor's degrees. Some smaller, regional airlines might require no more than a two-year degree, but if your goal is to one day captain a large, commercial jet, get your bachelor's degree. It doesn't necessarily have to be an aviation-related degree, but if you know early on that being a commercial airline pilot is what you want to do, that might be your best option.