Some coral reef with a shallow end gets affected by climate change but when it comes to the Great Barrier Reef some of the corals are deep in the ocean but some are in a higher level. Therefore climate change affects the Epipelagic zone of the ocean, but it's only a matter of time when the Abyssopelagic zone and the Hadalpelagic zone of the ocean are often left untouched.
So I guess 1 of the reasons of how corals survive is because of the depths of the ocean. Another reason is a fact Catalina brought up, it was that people touched corals not only that but some other people have been collecting them and sailors have been dropping anchors on the coral reef or some people build resorts on top of the water but almost 23% of the resort owners build on top of the coral reef
The needs of corals is first of all sunlight. Corals need sunlight so generally live in water temperatures of 68-90°F or 20°-32°C so the corals are mainly at the Abyssopelagic zone
I'm also pretty certain is that is what it is because corals also need clearwater, fishers and sailors and etc. release oil and toxic chemicals into the water live if they were in the Epipelagic zone or the Mesopelagic zone (Corals are very sensitive!). But not only that but Corals need saltwater to survive and require a certain balance in the ratio of salt to water.