Sin is simply doing something that is forbidden by God's law.
Humans have an innate sense of right or wrong that we generally live by. For example, everyone knows stealing, assaulting, or murdering is wrong.
So most people innately know, through their conscience, some things that are right and some things that are wrong.
The wrong/bad deeds from a human perspective can be called sin.
But a complete and thorough list of sin comes from God. This list can be found in God's law in the Bible.
Anyone who does not abide by that list commits unlawful deeds (in other words sin).
[As an analogy example, we can take a look at math. According to mathematical principal, we know that 1+1=2 and 3 x 3=9.
A child in a math class can give a different answer than 2 or 9. But he would be marked on his test as wrong and getting 0 points.
Anyone can give a different answer than the correct answer. But they are all wrong.]
If we look at sin in a similar way, anyone can deviate from God's law, but he would be sinning. Just as anyone can give an incorrect answer, but that answer would be always wrong.
So it is the human that decides to sin or give an incorrect answer, it is not the teacher who is wrong or God who is wrong for giving the law.
The Bible tells us that "all have sinned and fall short of the glory of God" (Romans 3:23).