To become a pilot for a commercial airlines, you will need to get a commercial pilot license (CPL). To get the license, you will have to undergo training at any given DGCA certified flying school. The course is usually 12 months long and costs anywhere between 20-25 Lakhs. I would suggest you complete graduation before attending pilot training to keep a viable backup plan in case things don't work out. Most commercial airlines prefer hiring experienced pilots, but how will young pilots gain experience if they aren't allowed to fly? This paradox is the reason becoming a pilot isn't a safe bet anymore.