Gita 04.17 explained
karmaṇo hy api boddhavyaṁ
boddhavyaṁ ca vikarmaṇaḥ
akarmaṇaś ca boddhavyaṁ
gahanā karmaṇo gatiḥ
karmaṇaḥ — of work; hi — certainly; api — also; boddhavyam — should be understood; boddhavyam — should be understood; ca — also; vikarmaṇaḥ — of forbidden work; akarmaṇaḥ — of inaction; ca — also; boddhavyam— should be understood; gahanā — very difﬁcult; karmaṇaḥ — of work; gatiḥ — entrance.
The intricacies of action are very hard to understand. Therefore one should know properly what action is, what forbidden action is and what inaction is.
We can know from scriptures, but scriptures also says many things, so Krishna said I will tell you three things: Know what is Karma, Vikarma & Akarma. Working of Karma is complex.
Karma -> the action which brings good result.
Vikarma -> action which are against scripture which brings bad reaction.
Akarma -> Is not inaction, it is action which brings no reaction.
Understanding intricacies of karma is very difficult but understand that certain action brings reaction, some brings bad reaction and some brings no material reactions.