What is sin?

Sin is any want of conformity unto, or transgression of, the law of God. (Shorter Catechism, A. 14)

1 John 3:4 (NASB)
Everyone who practices sin also practices lawlessness; and sin is lawlessness.

The KJV (1611) translates this verse “transgression of the law.” However, it is possible to sin when there is no law; (Rom. 5:13) therefore, sin is more than transgression of the law, sin is lawlessness, living in such a way that there is no law or law giver. 

Sin is always against God because it is going away from God, it is rebellion against the creator and the way that he has created the world. Sin is wanting ones own way, it is refusing to acknowledge God as the Sovereign Lord of the universe, and for that matter, the Sovereign Lord of your life. The absolute essence of sin is placing one’s own will above the will of God. (BBC) 

When Jesus was questioned about sexual sin, he did not do what his questioners expected; they expected him to go to the law of Moses but he went to the beginning. 

Matthew 19:4-5 (NASB)
And He answered and said, “Have you not read that He who created them from the beginning MADE THEM MALE AND FEMALE, and said, ‘FOR THIS REASON A MAN SHALL LEAVE HIS FATHER AND MOTHER AND BE JOINED TO HIS WIFE, AND THE TWO SHALL BECOME ONE FLESH’?

Sin is going away from God’s plan and will. Sin is not only transgressing the law but it is also knowing the right thing to do and not doing it. (James 4:17)