In the AnimationSprite node, in SpriteFrames, you can create new animations on the left. By default there is already one created, and it is called "default" at 5 FPS. Choose your animation if I create more than one, add all the frames you want, either from separate textures or a spritesheet. Then, from code you can run the animation with:
Where player is the name of the SpriteFrame node.
To stop it:
In the editor you can preview the animation by Playing checkbox
Look for SpriteFrame in the editor's documentation for more options.