A pause icon is the standard way to do this, positioned close to the animated element. It would be a good practice (if the design allows) to then have a popup that says "do you want to stop all animations on the site?" and then store the answer in a cookie.
For site wide animations another option is having an "accessibility settings" screen as part of the site to toggle it on and off. That way you can have a button that explicitly says "turn off animations" which is better for people who might have trouble understanding iconography (i.e. people with autism sometimes struggle with "abstraction" of imagery and struggle to get the meaning from an icon, although a pause button is probably OK).
You should also use the CSS selector
That way you can switch animations off automatically for users who have set their OS settings to "reduced motion".