What is the most logical next event?

How to uncast a horse
Remain calm, as a clear head is essential for dealing in dangerous situations.
Let the horse know you are present by humming, whistling, clearing your throat, etc.
They may calm down when they know a human is nearby to help.
Determine whether you can open their stall without them sticking their feet or head out. If you can't access the door, climb over a wall, and calm your horse down.