The last creatures to survive on Earth will be tiny organisms living deep underground, according to scientists.