Sharks are “ectothermic”, which is a fancy way of calling them cold-blooded. They are unable to regulate their own body temperature. Instead, it is determined by the surrounding environment. That is why most sharks like to stay in temperate or tropical waters, rather than polar environments (although there are some cold water sharks).
Whales are “endothermic” or warm-blooded. They are able to regulate their body temperature internally, which enables them to easily use cold as well as warm environments.