Elephants are not going extinct as of now.
Although elephants are dropping in population which means that eventually years from now elephants may become extinct.
But it's unlikely that elephants would become extinct in the next 500 years or so.
Elephants could become extinct in another 1,000 years or so but for now it's unlikely that the elephants would become extinct.
You can even keep elephants as pets even without a license because the elephants are not considered to be endangered as of now.
Years from now that could change though but it would take many years for that to happen.
There are still around 50,000 elephants in the world so they are doing okay so far.