The Bible says that "all have sinned and fall short of the glory of God" (Romans 3:23 NIV). Sin is disobeying God's laws and not doing what He wants us to do.
Everyone knows there is a difference between right and wrong, even people who have never heard of God's law or read the Bible. Jesus taught that God's two most important laws are to love God and to love our neighbor the way we love ourselves (Mark 12:28-31). The second of these two laws means that we must act toward others as we want them to act toward us. This law has become known as "The Golden Rule." We know what we do not want other people to do to us. So when we do those things to others, we know we have sinned. That is why anyone can understand that they have sinned.