If you're on a trekking horse, they're likely to have many bad habits like pulling the reins, shaking their head, being very hard mouthed, and so on. Hopefully they shouldn't bolt, but instead be hard to get past a slow slow walk ...
Can you tell I've had some sucky experiences trekking?
Experienced riders stay on a bolting, rearing or bucking horse by being relaxed, believe it or not. They know how to move with the horse and can stay calm, and therefore stay in the saddle. If you take riding lessons, you will soon learn that the more tense you are, the more you bump and bounce about, but if you relax everything and pretend to be jelly you won't move much at all.
For novices, hold onto the saddle and the mane! The horse has no nerves in its mane so you can pull as hard as you need to, and even if the saddle slips the mane can't. Keep hold of your reins and turn the horse in a circle, because they can't run so fast if they need to balance while turning. Try and relax to make things less bumpy, and don't squeeze hard with your legs because the horse may interpret this as an instruction to go even faster.
If you believe everything you read, better not read.