I never really learnt how to do them per se; between working on my squat depth and yoga I developed good ankle flexility* and balance, and my squat numbers aren’t terrible for my bodyweight so when I tried to do pistols I got the hang of them pretty quickly as I had both the mobility, strength and balance. I now use my lifting shoes* and do them by the edge of the stairs or on a box so my free foot doesn’t have to be lifted quite as high throughout, because I’m more interested in taking each working leg through a full ROM than anything else.
*this is the no1 reason most people can’t do them. If you have limited dorsiflexion then you can’t get your knee forward past your toes. If you can’t get your knee forward, your hips will be too far back and you’ll fall over backwards. You have to be able to keep your centre of mass over the middle of your foot from top to bottom. I can do them barefoot fine but use lifters (shoes with hard sole and heel lift that’s between 0.65-1”) because they provide a lot of lateral stability and provide the equivalent of even more flexible ankles, which makes just concentrating on going down and up easier.
The other reason people struggle is they might already do leg work but when they go to pistol they’re not used sitting on their calves in that deep position and so haven’t built up strength at the bottom to initiate standing back up.
My tips would be:
Balance - have something next to you to hold on to, or tie a resistance band to something and use that like a rope to keep you steady, don’t rely on it and you’ll need it less and less over time. Do single leg balance stuff when you’re cleaning your teeth or waiting for the coffee/tea to brew.
Flexibility - sit in a bodyweight squat for 5 mins a day, opening up your hips and leaning onto each thigh to push the knee forward and stretch the calf/get the ankles down on the floor. If you have weights you can do loaded hip and ankle stretches too which I like.
Strength - if all you’re doing is single leg bodyweight work, use an assisted variation where you can still get full ROM and complete reps, then over time use less assistance... and if you lift already then you might well have the strength already, you’re just lacking one of the two above.