Whales are mammals, so in many ways, they are just like human beings. The most important difference is that humans and whales live in different environments and whales have a special respiratory system that enables them to stay underwater for several minutes without breathing oxygen. For this reason, they are said to be voluntary breathers. That is, because of whales underwater environment, they must be conscious breathers. They think about every breath they take and come up to the surface of the water to breathe through blowholes on top of their heads.
What is outstanding about whales is the way they can sleep. While all mammals sleep, whales cannot afford to become unconscious for long because they may drown. The only way they can sleep is by remaining partially conscious. It is believed that only one hemisphere of the whale's brain sleeps at a time, so they rest but are never completely asleep. They can do so most probably near the surface so that they can come up for air easily.