The process of altering a natural habitat in a way that affects the ability of organisms to survive and thrive.