The scientist who studies the relationship of an organism and its environment is called an ecologist.
Ecology is the branch of biology that focuses on the interactions between organisms and their surroundings, including both living (biotic) and non-living (abiotic) factors.