Make Animation Play Once?

I want to make a code that makes an animation play through once when…

if(Input.GetButtonDown("Fire1"))

But, I’m not sure how animations work in coding. Can anyone help me out?

https://unity3d.com/learn/tutorials/modules/beginner/animation/animator-controller?playlist=17099

I’m still kind of confused. I just want to make an animation play when I press Fire1