In my experience, it is really something you have to learn yourself through patience, sacraments, prayer, and good mentors/confessors. I know that’s not an easy answer but its the one I believe is best. Just keep on the right path and, in the end, God will deliver you from all anxiety.
The following is all advice of mine that may or may not be helpful:
I. Use Your Common Sense
Use your common sense and examine things you insightfully think are voluntary or involuntary. For example, I am sure that you may flinch if someone swings something near your face. Internally, you are probably aware that this action did not occur with you
deliberately consenting or doing it with
full knowledge. Furthermore, the action, though it may have been ‘bad’ to do (maybe it betrayed a lack of manliness

), probably did not presuppose that it was ‘bad’, whereas if you had more time or more experience to predict it, might have had this presupposition. I tend to think that God has made it fairly clear to us when we mortally sin. There seems to be a conscious and personal rejection of morality for some particular thing, and for this to happen you must presuppose it as wrong/immoral and
purposefully act
while being aware of the specific acts
connection to this presupposition.
II. Apply Your Common Sense and Church Teachings To the Particular Action
As a man, you probably have some bad habits that have developed and you may find your eyes lustfully turning at the presence of any woman’s body. Now your eyes turning might not be deliberate, and may be more akin to flinching, but as long as you did not embrace it, so as to make it a personal choice, it is probably involuntary or venial at worst. If it is venial but lustful, resist it, do a very brief mental act of contrition, fill yourself with hate of sexual impurity, and move on in peace and love for your neighbor. If on the other hand, you see a woman pass by, you become aware of a temptation to lust (and perhaps you have already had to avert your eyes once) and you sort of ‘say’ to yourself ‘this is wrong, I want this anyhow (maybe you even wish it weren’t wrong)’ and you either turn your eyes (or mind) or deliberately leave them there, then you have likely committed a damning mortal sin.
III. Avoid Feigned Ignorance and Scrupulosity
Be wary of excuses of feigned ignorance, but also be weary of scrupulosity. If you have feigned ignorance, it basically counts as being aware of the wrong, so it is far worse than scrupulosity since it can be damning, but scrupulosity is an evil too and the Lord hates it as well. I think a sign of feigned ignorance is when you could see the awareness of wrong becoming more present in your mind but you consciously filled your mind with as much noise (or emptiness) as possible to block it out and committed the wrong. I think a sign of scrupulosity is when you try and set yourself aside in true honesty, and despite the fact that you cannot find that you were aware of the coonected wrongness while purposefully acting, you spend significant time still searching to see if you had such awareness.
IV. Distinguish Lust from Other Reasons for Looking
Also note that just because you deliberately look at a woman does not necessarily mean you are lusting. How, where, and why we look can often be a determination of whether the object is lust or some non-sinful curiosity. If something is ‘revealing’ and we take pleasure in or move our eyes to that specific fact, its probably a sign of lust (though it may be venial if not done with deliberate consent or pressuposition of the wrong). However, I think we can look at women without the intent of lust, and even
at times recognize their beauty (as long as it is not their beauty in a sexual way) without sin. I think some saint said something like, for us men, looking at women is like looking at the bright beauty of the sun, and that we must be very wary of looking too long lest we start to sexualize things, just like we may hurt our eyes on the sun.
Hope that is of some help.