The younger birds show evidence of once having a thing called "protowings" this means that their wings can not be used properly yet. Through this early seemingly pointless observation we can see that birds used to be used for gliding.
https://youtu.be/3USAC-Ky25sExample of embryology as proof.