If whales are mammls like us then how do they sleep underwater without breathing?

They don't sleep like we do. They are able to let one half of their brain sleep while the other remains conscious. They continue to surface for air.