When descending the slopes in Beacons, I would always lean back to keep my body upright and transfer my weight to the stirrup bars, which I'd push forwards and then 'walk him down , left then right, then left and then right, to match when he was putting his feet down. I'd also let him lean on the bit which would invariably be a mild snaffle. It is important to keep the horse in balance and to 'save' his front legs.
I'd try to hold his speed down, so that it did not build up, being aware that if it was a soft surface he'd slide a bit. If he did get to trotting downhill, then I'd stand in the stirrups, locking my knees into the knee pads.
Going up, I'd come out of the saddle, put all my weight on the stirrups, push my inner knee to the saddle pads, give him a loose rein and make sure I kept my weight off his back. At most I'd neck rein, leaving him ample free rein to pick his course around the rocks.
Its tricky, so much depends on the surface, so much on the fitness of the horse.
My Joe was as much goat as horse when it came to climbing slopes. He was used for sheep herding in the hills - that's a fun game.
Going downhill on a sandy path, he'd almost slither down on his hind feet.
As for my present mare - well, she'd might well fall over on a steep slope and if I ever came up and off the saddle she'd take off and I'd have to come downhill Capt Caprilli style leaning forwards - disconcerting to say the least.
Remember that if a horse starts to canter downhill on a hard surface, even with studs it will find it hard to even slow, let alone stop, until it reaches the bottom of the slope and the ground levels out. Then the only way for you to ride is to lean right back and push the feet out forwards in the stirrup irons.