How to use OnAnimationFinished()?

The documentation isn’t clear on how to use this function. Can I use it to make something happen when an animation has finished playing?

Thanks in advance