What does it mean to sin?

The superficial answer is “Breaking of God’s law.”

The deeper answer is “Sinning is the state or condition of all man.”

For example, a fish swims and a sinner sins. Everyone is born into a condition called sin (Except for Jesus who is without sin).

No one can escape this condition by obeying the law or doing righteous works. The bible compare the righteousness of a sinner to a filthy rag.

Isaiah 64:6 But we are all as an unclean thing, and all our righteousnesses are as filthy rags; and we all do fade as a leaf; and our iniquities, like the wind, have taken us away.

The law was given to make everyone aware that he/she is a sinner.

Romans 3:20 Therefore by the deeds of the law there shall no flesh be justified in his sight: for by the law is the knowledge of sin.

The law cannot save anyone. But the law is necessary. Because without it, everyone will not know what is sin. Resulting in not having the need for a saviour (Jesus).

We are commanded to be perfect as the Lord your God is perfect.

As has been said man is a sinner, his nature is to sin and even as a saved sinner, a Christian we still sin.
This is so ingrained into us that John has to say, " If we say we do not sin, then the truth ( Jesus ) is not in us! "

It is a mark of the depth and length of Jesus’s love for us that he forgave us and continues to forgive us.