A basic technique.
When you get stuck in a dune, reverse till the bottom of the dune. Never try to turn in the slope because you could roll over.
In a gentle slope, use the same technique but turn the steering wheel quickly right and left while accelerating progressively. Sometimes, it will be necessary to engage the short gear.