Learning a technique is one thing: you have a compliant partner, you learn the steps and BAM! There it is. Getting a submission against a resisting partner is different. They resist. They try their own counter techniques. They use strength. You get tired. In short, you have to adapt.
For the most part, learning to adapt in BJJ comes through sparring. You gradually learn what works and what doesn’t through trial and error. You learn what sorts of adjustments you have to make, how you have to wait for people to get tired before finishing the move, and all sorts of other details.
However, you can get a step ahead in the adaptation game by learning more than one submission from every dominant position that you know. If, for instance, all you know from rear mount is the rear naked choke, you don’t have any other option except trying to force in that one technique. But, if you have invested the time to learn say, three techniques, then you might have better luck. At worst, when one technique fails, you can switch over to another and at best, you notice which of the three techniques will work best based on how your partner is resisting.
Three isn’t the limit, of course, you might learn half a dozen or more techniques to finish with, but it is a pretty good starting point for learning how to submit a resisting partner (rather than a compliant one.)