Why do organisms live in certain places?

An organism lives in a certain place to meet its basic needs. Which brings me to adaptaion,which is a certain trait or ability an organism gets from his/her parents. For example, a giraffe's long neck is an adaptation. In order to survive, a organism must have everything it needs to survive. Such as, plenty of food, and the temperature cannot be too hot or too cold. Hopefully, this is helpful to you. Thank you for listening.