A cockpit (also called flight deck in big airplanes) is the area, usually near the front of a vehicle, from which its pilot controls it.
Most modern cockpits are enclosed, except on some small aircraft, and cockpits on large airliners are also physically separated from the cabin. From the cockpit an aircraft is controlled on the ground and in the air.
Most mecha also contain cockpits for a human operator.