Sin is the breaking of God's law. If God says "Do not lie" and you lie, then you have broken His law and sinned. When you sin, you offend God because it is His law that you have broken. Also, the reason God says to not lie, not cheat, etc., is because these laws reflect the moral purity of His nature. Therefore, the Law is a reflection of the character of God. It is wrong to lie because God cannot lie. It is wrong to steal because God cannot steal, etc. The moral law is not arbitrary. It is based on God's holiness.
The law, then, is a standard of moral purity. The Old Testament contains the Law of God. It is a perfect standard because it is God's standard. When we fail to keep the law, we sin. When we sin, we offend God. This offense against God results in a judgment. Laws are laws because they have penalties. There is no law without a penalty. Therefore, breaking God's law brings judgment which is separation from God. "But your sins have made a separation between you and your God," (Isaiah 59:2). And, "the wages of sin is death . . . " (Rom. 6:23). So, to sin, to break God's law, results in judgment. The judgment is known as damnation which is the righteous judgment of God upon the sinner. If God did not judge the sinner, then He is not upholding His holiness; and he would be allowing sinners to go unpunished.
Of course, Jesus came to take our place and die for our sins (1 Pet. 2:24). This means that Jesus bore our sin in His body on the cross and paid for them. He took the judgment upon himself. This further means that anyone who trusts in what Jesus did on the cross will have his sins removed; he will be saved from God's future judgment.
So, replying to the question "What is sin?" is best answered by saying that it is breaking God's law. All people have sinned. Therefore, all people are under God's judgment--except for those who've trusted in God's provision to escape that judgment.
Where are you? Are you in the place of God's judgment or of salvation in Christ?