You practice on level soft surfaces (like grass/a field) and practice unclipping and clipping back in. When you get decent on this, you start on easier trails. You do not unclip for technical/challenging sections, as this is usually a guaranteed crash. You'll have far worse control and stability unclipped, and you need to build up your skills. Walk the bike through such a section unless you are confident you can ride it, and if you think that's the case, you clip in and ride it, hold on tight, point the bike where you want it to go, do not let go. A common newbie mistake is putting on clipless pedals and going to ride your favorite trail, before becoming proficient in their use. For those of us that have been on them for years and use them for everything from downhill gaps to cross-country races, unclipping is second nature and we do it so fast we don't even notice. If we lean into a turn, we have unclipped our foot. If we start to "go over" our foot is already off the pedal and ready. That's what you practice.