HOW TO make anmations scripts for my character

i made the 2d animations but let’s say
jumping: i want to play it automatic when jumping but how?

brackeys tutorial video, helped me out with figuring out how to do animation