We have several spectacular and amazing videos of aircraft, flying high in the sky. How are these videos filmed, at great altitudes?
Two words: chase planes.
A few more words: The easiest way to film an airplane in flight is with another airplane in flight. Here's one article on how that's done, including images captured from both sides; the chase plane (a Learjet 25B) getting the shots of the 787 Dreamliner, and crew aboard the Dreamliner getting a few snapshots of the chase plane.
Early shots taken from chase planes often used simple handheld cameras; a two-seater would normally be used with the pilot in front and the photographer in back. This is still a totally viable way to do it, but more modern professional shoots utilize aircraft specifically modified for the task by adding internal or external camera mounts, optical-quality viewports, etc. Here's a modified T-33 used by Boeing specifically for air-to-air photography, including some of the initial publicity shots of the 787 in flight; notice the camera mount between the seats that can be used by the GIB (he's using a handheld in this photo:
For lower-speed shots, you can also use a helicopter. Many of these such as news choppers have remote-control cameras on gyro-stabilized mounts, so the vibration of the airframe is minimized in the shot even at high zoom:
These same camera systems can be used for air-to-air shots as well, however the maximum airspeed of the helicopter becomes a limiting factor. Still great for publicity shots of small prop planes, or takeoffs/landings.
I film all my stuff (from inside the plane) with a GoPro. This seems to be the common way the smaller guys are doing it. There are companies that make mounts that will even hold the camera on outside a plane. You can check out this post from Sporty's on the matter. Some of the stuff shot by the pros may be taken from another plane or a helicopter. The news choppers I see leaving from KPNE have the newer nose style cameras that I assume they operate from the inside of the chopper.
You are not specific in your question, so there are many ways that aerial footage can be captured.
As Dave mentions, GoPro cameras have gained popularity especially with private pilots. They are relatively cheap, small, easy to use, and capture good quality video. Many videos from inside the cockpit or outside use cameras like these.
Air to air footage is taken from other aircraft. For the most flexibility, a fighter jet is a good choice. You could also shoot through the door of a smaller aircraft. Helicopters are best at lower altitudes and speeds but are good for filming takeoffs and landings.