How to get current category

You can use get_queried_object(), which will return category object.

See documentation:

https://codex.wordpress.org/Function_Reference/get_queried_object