Sometimes you don't need a state machine at all and can do everything in a single Update function that gets called once a frame.
If health is <= 0 and dying animation not playing, play it and return. If dying animation is done, do game over and return. Check arrow keys, update velocity. Check whether the player is touching the ground, if so reset the jumping flag. If jumping flag is false and jump key is pressed, set jump flag and add lots of upward velocity. If jumping flag is set and jump key is released quickly, subtract a bit of upward velocity to let the player perform a smaller jump. Potentially add another flag to prevent the user from repeating this multiple times in the same jump. If player is capable of flight, holding the jump key while jumping adds a little bit of upward velocity. If fire key is down, and firing is possible now, then fire. Apply velocity to position. If in air, use jumping/flying animation. Else If on ground and speed > large threshold, use running animation. Else If on ground and speed > small threshold, use walking animation. Else if on ground use idle animation.