I John 3:4 Everyone who sins breaks the law; in fact, sin is lawlessness.
I John 5:17 All wrongdoing is sin, and there is sin that does not lead to death.
James 4:17 Anyone, then, who knows the good he ought to do and doesn't do it, sins.
The answer is two fold. We sin by the things we do (lawlessness and wrongdoing) and by the things we don’t do (not doing right things we know we should do).