As a general rule when I get tangled up in the guard for example, I look to recover posture through structure and distance rather than proceed forward with a counter-pass attempt.
Remember, counter moves are fun to play with and can serve to confuse an opponent through manipulating expectation, but think about it, it means you’re starting from a step behind! You’re also banking on the fact that you’re training partner doesn’t have a counter to the counter, and so and so forth.
So first off, learn how to recover posture and build a primary option from there under the protection of structure and distance. Then you can use this knowledge to understand difference between recovery and counter-moves and how THOSE things can work together when built from a proper foundation.