ANSWER: Before we answer your question, we need to define what IS sin. A correct but incomplete definition is that it is the breaking of God's commandments or laws (Isaiah 53, Hebrews 10:26-27, Matthew 12:31-32, James 1:14-15, 2:10-11, 4:17, 1John 3:4, 8-10, etc.). It is, however, more than that. God's existence is a living definition of perfect love (1John 4:8, 16). This means that EVERYTHING he says, does and thinks is perfect and based on a character governed solely by love. Sin, therefore, is any thought or action that God would not think or do himself.
Sin first came into being in the mind and heart of the angel Lucifer. God brought him into existence possessing every positive trait, gift and advantage he could give (short of character - see Ezekiel 28:12 -13, 15). Lucifer was initially a loyal spirit being who sang for JOY at the creation of the physical universe (Job 38:4 - 7). His responsibilities included being one of only two angels who covered the very throne of the Almighty (Ezekiel 28:14).
Over time, however, Lucifer (whose name means 'morning star' or 'light bringer') started to convince himself that God's ways were not correct. He began to think that the best way to live and govern everything was NOT through unconditional, outgoing love. A better existence, he reasoned, was one founded on self-interest and competition, ruled over through a merciless and loveless hierarchical system with himself (of course) at the top. He obsessed over his appearance to the point of vanity and pride (verse 17). His obsessions and increasingly perverted thinking ultimately led him to conclude that the only way to implement his ideas and fulfill his goals was to make HIMSELF ruler over all creation (see Isaiah 14 and Ezekiel 28). Since God was clearly more powerful than Lucifer, any attempt he made to take the throne of the universe would fail. The devil soon reasoned that if he could get other angels to believe his lies, he could storm heaven with an army. He did just that after deceiving ONE THIRD of the angels (Revelation 12:3 - 4, Isaiah 14:13 - 14).
Satan likely thought that a massive show of force is all that was required in order for the Eternal to acquiesce his throne. He ended up making, however, a tremendous miscalculation (to say the least) and a grave mistake (pun intended - Isaiah 14:15).
Adam, Eve and the Tempter
The devil's perverted thinking and sinful rebelliousness spread to the human race by enticing the first humans to think as he does. The apostle Paul wrote about how disobedience and suffering entered the world when he stated, "Therefore, as by one man sin entered into the world, and by means of sin came death; and in this way, death passed into all mankind;" (Romans 5:12, HBFV)
God, as the all-powerful Creator, has a right to determine what is right or wrong (good or evil) for the entire universe. He told Adam (Genesis 2:16 - 17) and Eve (Genesis 3:1 - 3) that it was GOOD to eat from the trees in Eden with the exception of just one tree (from which it was BAD or WRONG to do so - Genesis 2:17). Adam and Eve’s test was whether they would believe what God said and trust that his judgment had their best interest in mind or reject what they heard for something else. They choose to REJECT God's words and replace them with what THEY DECIDED 'should' be good for them (eating of the forbidden fruit - Genesis 3:6). They decided that Satan's perverted thinking and distorted conclusions were correct! It is interesting to note that Eve had to convince herself (self-talk) that her own logic could determine what was best for her (3:6)!
The good news is that God will, in the not too distant future, clean up the 'mess' brought by sin and its consequences (Revelation 21:4). All those who willfully choose to reject the way of righteousness will receive eternal death with no hope of a resurrection. Satan, the father of sin (John 8:44) will also likely be destroyed in a lake of fire (see our article entitled 'Will the devil live FOREVER?' for more information) and his demons will receive their judgment and punishment.