You look where the species lives, which can often be a limited area, and see if there is any evidence of them before declaring a species extinct. It is a careful consideration, but we’ve been wrong before, and probably will be again. Scientists have no problem admitting when they are wrong, especially not on this.
A great example of that is family of fish called a [Coelacanth](https://upload.wikimedia.org/wikipedia/commons/b/b7/Coelacanth_off_Pumula_on_the_KwaZulu-Natal_South_Coast%2C_South_Africa%2C_on_22_November_2019.png). Coelacanth fossils were discovered in 1839, with fossils as old as 410 million years old and as recent as the late Cretaceous period, around 65 million years ago, when we stop finding Coelacanth fossils. Given that there were no Coelacanth fossils younger than 65 million years old everyone figured that they just went extinct like a whole lot of things did at the end of the Cretaceous period. Then in 1938 a museum curator from South Africa named Marjorie Courtenay-Latimer, who had told local fishermen to let her know if they found anything strange, got a phone call from a guy who caught a weird looking fish. It turns out that Coelacanths were not extinct at all, they were just very rare. Since they aren’t good to eat fishermen had just been throwing them back when they caught them.
Latest Answers