Sharks will be crushed by their own weight when out of water, and it is harder for them to float then you might think!
Shark skeletons differ a lot from the skeletons of bony fish and terrestrial vertebrates. Their skeletons are made of cartilage and connective tissue which means they are cartilaginous. The fact that this reduces the weight of a shark's skeleton means it also saves energy.
Sharks do not have rib cages to protect their internal organs, and when out of the water they can very easily be crushed under their own weight. When they are in the water, the buoyant force acting against their weight prevents this from happening.
They do not have gas-filled swim bladders for buoyancy like other fish and have to use their pectoral fins in a manner similar to the use of wings by airplanes. This is called 'dynamic lift'. As they swim, they position their pectoral fins to create lift which allows them to maintain a certain depth.
There is a myth that sharks have to keep moving in order to breathe, but they actually have to keep moving to stay afloat because they do not have swim bladders. This is also why they are incapable of swimming backwards or hovering. While at rest, most sharks pump water over their gills to ensure a constant supply of oxygenated water.