You mean when stationary in a trails-esque way or still slowly rolling?
If stationary, with brakes on, push down > back > up on the pedals (a circular motion) whilst pushing your weight forwards. forwards. More than you think. Arms pretty straight to get your centre of gravity highish. More leverage for pulling the bike’s rear up. You can always just release the front brake if you feel you’re going over the bars.
For lifting the front, brakes on, weight back. BACK. More than you think (see the pattern here – exaggerated movements). Pull back on the bars. Depending on your strength and the bike, you may get the front up. You may need a squirt of power through the pedals i.e. a lot of pressure on the forward pedal > brake off > brake on.
I always find this stuff easier to do on a rigid bike. You can always use the rebound on a suspension to help in by compressing and then pulling up as the shock extends.
Can you bunny hop? Learn from the master. Adding rotation isn’t that hard. Coil your body the opposite way to the way you want to rotate and then, as the wheels un-weight, uncoil.
For less trailsy, practice rocking (stationary), rock more and more until either wheel lifts. Rock more and more until it lifts for a longer period. Then use the body coil effect to move the wheel. I always find the back will rotate more slowly doing this. The front is faster as it’s more of a brute-force type move.
For endos, rolling very slowly, steer slightly in the opposite direction to the way you want to turn and coil away from it too. As you hit the brake, turn sharply into the turn and uncoil.
All of this is very hard to explain. As always, the best way is to watch other people. Youtube is full of amazing trials riders.
Also, practice somewhere soft and use flat pedals.
FWIW, I’m not particularly good at trials riding. Entered a couple of comps when I was younger and sucked. I only do it now for car park kudos. In what world doesn’t a 180 endo look cool? The ladies love it 😉