Sit back and keep your eyes up the worst thing you can do is panick try to pick it up while you're riding but if you are unable to lean back and ask your horse to halt or slow down so you can have a chance to pick it back up
Stay calm and dont stop or look down and camly get your stirrup back. In my lesson i have, my instructor makes us take our feet out the stirrups and without looking get it back while still trotting or walking. This is very helpful to prepair for a situation when you are out and you lose your stirrup. 👍🏻
Keep riding! Do not stop to get your stirrup back and especially do not look down to try and gain your stirrup. Take a deep breath and search for the stirrup calmly, trying not to distract or confuse your horse. Exercises at home practicing taking both feet out of the stirrup and putting them back in can help prepare you for when a stirrup is lost in competition or in the middle of an exercise.
Try get your stirrup back without losing balance or spooking your horse. If you can't get it back, do not tense your leg and just continue riding. Tensing your leg will make you grip with your knees, causing imbalance that can result in a fall. I advise you practice work without stirrups at home. Do lots of flat work so you can work on balance & then move on to jumping when you feel confident to do so
The first thing to do is before entering the course, because often we lose the stirrups because they are badly adjusted either too long or too short. The second thing to do before doing a course is to wipe his shoes, often sand or a wet sole can slip.
If you still lose your stirrups during a journey, do not panic, you must remain hyper calm, stand straight, and pretend you were galloping sitting and regain your balance.
Afterwards, you can either try to re-shoe without stopping; Either you stop and you go back. But by doing this in competition, you risk having points wrong ...
Most of the time, if one does not succeed in rechussing one continues and one leaps without stirrup not to stop, it is a little risked especially if there are big jumps. Afterwards you can learn to jump without a stirrup like that, if it happens you will know how to manage even if they are big jumps (the solution: session of obstacle saddle).
Have a good day :)