Playing an animation

Hello!
I have an object with an animation component, and the animation component has 2 different animations attached to it. I am wondering how to play either one of them through script.
Thanks.

Example :

First animation name attacked is : " animation1" , And the second “animation2”

GetComponent<Animation>().Play("animation1");
//OR 
GetComponent<Animation>().Play("animation2");

Hmm, it isn’t working.
Pretty much I have an animation that moves a panel down and an animation that moves that panel back up when the player presses Space. I tested it on another script with just Input.GetKeyDown and it still didn’t work. The panel going down animation is working fine but the panel that goes back up isn’t.