James 4:17 (KJV) Therefore to him that knoweth to do good, and doeth it not, to him it is sin.
Sin can arise from both omission and commission. It’s not enough to avoid doing the wrong thing, you have to go out and try to do the right thing. Not doing what we know God asks of us violates God’s will for us and is a sin.