Habitat is the place in which a creature live. A fish habitat is the sea, and a gazelle habitat is a flat desert.
Imagine your home where you were brought up! It has running water, has a range of temperature that is not too high (+50°) or too low (-10°), has certain privacy behind walls that won't show what you're doing, has toilet and waste disposal ways. Let's assume too that you cannot live without a Cinema and a bookshop nearby.
Now imagine you move to another country. You should choose your home where there's a Cinema and bookshop nearby.
This should narrow down your search to fewer places.
This might be a ridiculous example but that area that fits your "life requirements" is what scientists call your "habitat". Scientists will try to recognize what defines it for all living creatures with whatever preferences and scale of the places they like to live in.
Consider the Coral Reefs of Ras Mohamed: they grow only on the beach or shallow bottoms and nowhere else (corals don't float in the middle of the Sea and won't grow on beach sand out of water). So many species of fish and crustaceans (pronounced crust-a-shans and is a single name for all types for lobsters, shrimps, and their marine look-alikes) live on the corals and call it their habitat. They just cannot leave it because there is where all the fun and life and food for them. This place (Habitat) together with all its creatures are called the Ecosystem of Coral Reefs.
They're hills or small mountains made entirely from very small grains of sand that are formed by the wind and can move for tens of meters during major desert storms but still never leave their known areas! They've fascinated many non-Saharan people as the most exotic if not dangerous of all desert landforms! Myths have been told about them and offroaders —in their shining armored 4x4s— have feared them for long.