The Hangars in GTA Online allow you to store aircraft and run an Air Freight Cargo business.
The game offers Hangars at two locations: LSIA and Fort Zancudo Military Base. Hangars in Fort Zancudo also give you access to the military base (you will get 4-star Wanted Level otherwise).
Buy a Hangar
Go to the Maze Bank Foreclosures website as you would when buying a Clubhouse. Then, you may click on the “Hangars” option on the top-right corner to see only Hangars on the screen.
Generally, I would not recommend grinding with Air Freight Cargo because of its low profit and the difficulty of missions. Thus, Hangars would only be used to stash your aircraft and get clearance to the military base. For this reason, I suggest buying a Hangar in Fort Zancudo.
You can just go for the cheapest Fort Zancudo Hangar 3497 if clearance to the military base is all you need. P-996 LAZER fighter jets will spawn in the military base, and some players like to steal one of them rather than to buy their own jet. If you want to have a Hangar closer to the jet spawn points, then Fort Zancudo Hangar A2 is your best choice, though all Hangars in Fort Zancudo allow you to enter the military base without Wanted Level.
Storing Aircraft in Hangar
Airplanes and helicopters sold in GTA Online can be divided into two types:
Aircraft that must be stored in your Hangar. When you purchase such an aircraft, you can find a note about the Hangar requirement in its description.
Pegasus vehicles, which can be summoned by calling Pegasus from your in-game phone.
A list of Pegasus helicopters and planes can be found here on GTA Wiki on Fandom.
For the first type of aircraft, you can summon them within the “Vehicles” option of the Interaction Menu.
For the second type, you can convert a Pegasus vehicle to the first type by requesting a delivery of your aircraft from Pegasus and flying it to your Hangar. For more information, you may read this section in the GTA Wiki.