Is loss of habitat the main reason animals become endangered?

It depends on the animal. If it is being hunted for food or animal parts then that may be the main reason.

If it is not hunted, then loss of habitat will be the main reason animals become endangered.