Single button to toggle Carousel Rotate

Hi all. I’m new at frontend and I want to make a button that can toggle carousel rotation.
When rotate is ON then it would pause it, and when it is paused then it would play it again.
I want it to work like a play-pause button.
Can anyone help me with this?

p.s.: Any advise is welcome. Tiniest of guidance can help. Thanks