How to trigger a particular animation(.anim files) when a particular key is pressed

Hello,

I have created a couple of animations(. anim files) on a game object. I would like to trigger a particular animation, when a key is pressed through C# code. For example, When I press “A” on keyboard, I want to trigger an animation(.anim file) named “A”. I am new to animation please help me with this. I’m attaching the screenshots of my animator controller. Thanks in advance. Please help me.

The simplest solution is to call Crossfade on your Animator when a specific key is pressed.
See Unity - Scripting API: Animator.CrossFade

After that, you can also try to configure transitions based on parameters:
see Unity - Manual: Animation Parameters