How do I enable and disable animation in the animator controller by keys in unity3d

I want to enable and disable animation in the animator controller by pressing the key down . I know if statement input . I don’t know where to start .

You would need to add a bool parameter to your animator controller and use it to transition to and from a state.
Then in script you would say :

if(Input.GetKey(KeyCode.AnyKeyYouLike)
{
    Anim.SetBool("MyBoolName", true); //or false
}