I would recommend reading some basic resources on current Cas9 technologies. Here is one such review on prime editing, which illustrates one mechanism by which you can force cells to use a favorable precise repair mechanism. The way that you do this is by providing a repair template as part of the guide RNA that can be directly incorporated (see figure illustrating mechanism).
Properly, this mechanism uses neither of the two pathways that you mention:
Since almost all precise repair strategies generally require repair templates, they must exploit the endogenous HDR machinery, restricted to dividing cells. This has been a bottleneck in therapeutic applications of gene editing, especially for the many neurological diseases involving mutations that affect post-mitotic neurons. However, as [prime editing] bypasses the need for HDR machinery, precise genome substitutions were observed (albeit at low frequency) in primary mouse cortical neurons.
Note that this is only one example of how you can control repair mechanisms. I suggest reading that review (Scholefield and Harrison 2021, Gene Therapy), which includes information on other methods such as base editing.
As for distinguishing NHEJ vs HDR, there are a variety of references on this that can easily be found by google, such as this one. I'd recommend doing some cursory research there as well.