Everybody knows that a sin is a sin because it transgresses the will of God. However, most people never stop to think of what we mean by the phrase "God's will." Is it just an arbitrarily imposed mandate upon us? Is sin, then, just to go against the whims of an unpredictable God? In my opinion, God's will is something far more fundamental. Namely, I believe that the will of God is truth.
But even this is too vague; "truth" also needs a definition. When we say that something is "true", we normally refer to an intellectual proposition of some sort, but that's not what I mean. Instead, I believe that the best definition of truth would be something like: "the nature of something as it is in itself." This more broadly means that a being who partakes in truth would be free from compulsion, "free" being the crucial word here. You could use even more words to describe this state, including: "authentic", "unconstrained", or even "spontaneous."
To be free from sin is to be free from compulsion. Thus, I will define sin as anything that impedes your ability to act from your authentic nature as a human being. But this hardly means that you should be able to do whatever you want - most of the time, our desires are a manifestation of constraint itself. To be truly free from sin is to have your actions be yours, and not the result of some mental compulsion. After all, sin compels us to act against what we really want, to place our stock in something that does not reflect our true nature and wishes.
The individual who sins has a false image of who he is. He paints for himself an overly simplified self portrait, ignoring those things that don't jive with his ideals or his perceived strengths. But it is just those things he ignores, just those parts of himself that he chooses not to identify with, that compel him to act sinfully.
To see this, I'll conjure up an imaginary person for you. Suppose that there is a woman who, above all else, identifies herself as a "people person". She focuses exclusively on the human aspects of life, meaning that there is nothing more important to her than emotions, feelings, and personality. Naturally, she wants as much social harmony as possible. But this woman doesn't realize that she is ignoring a crucial aspect of her nature as a human being. Because she detests the idea of interpersonal conflict, those parts of her which rightfully long for healthy objective criticism will "get angry", and rebel against her. Normally, this will mean that she gets out all her criticism in single, emotional bursts, and it is precisely her rejection of criticism that leads to its dominance over her.
This tendency for criticism is her sin. Until she learns to value those parts of her that need to view things objectively and critically, they will rise up and subjugate her. But if she is wise enough to value those parts (and humble enough to let go of her strengths, to an extent) they will stop controlling her, and she will be free of them.
Let me give another example: imagine a man, who, instead of being a "people person", identifies himself as a "steward of ideas". He would spend his days coming up with abstract theories to explain things, and nothing would give him more pleasure than to find the latest new perspective. However, a focus on abstract possibilities nearly always entails deficient attention to the facts of concrete reality. This person would repress any and all capacity for dealing with the world of concrete facts and the world of his senses, and so, like the woman above, the parts of him which identify with that concrete reality would rise up in rebellion. This could lead him to engage in several bad behaviors, such as obsessing or binge diving into sensual pleasures, but they would all take the form of an over-correction into concrete reality, to make up for his lopsided psyche.
Whether it is anger in the woman or sensual desire in the man, the point is that sin comes from what we refuse to see in ourselves. If you have an overly simplified picture of yourself, the parts of you that the picture leaves out will not stop harassing you until you correct it. In practice, this often means being realistic about your desires and your needs. You must be brave enough to see yourself as you are, a task which can often be very frightening.
Practically speaking, you must use two things to be ready to abandon sin: humility and love. If you are humble, you are willing to see yourself as you are, a being with both strengths and flaws. This humility gives you the capacity to stop relying as much on your established strengths, for it is these strengths that oppress the parts of you that you neglect. In truth, it is often these neglected parts that cause our weaknesses, as we forgo a hidden well of talent or strength when we refuse to develop them. But humility is nothing without love. Giving up sin means that you must be ready to love those neglected parts of you unconditionally and without regard to worth. This does not come on its own, however, for only God's love is up to that task. To truly abandon sin, we must do what is necessary to receive the light of divine love, for only the nourishment it brings can heal the neglect we have caused ourselves.
This popular quotation from the Book of Mormon pretty much hits the nail on the head:
"And if men come unto me I will show unto them their weakness. I give unto men weakness that they may be humble; and my grace is sufficient for all men that humble themselves before me; for if they humble themselves before me, and have faith in me, then will I make weak things become strong unto them." (Ether 12:27)
All sin comes from self-neglect, or rather, by acting on a false image of who you are. But if you pray to God, asking Him faithfully and fervently to show you your true identity, He will set you on a path to find it. It will take great humility and patience, but at the end of the journey you will find yourself as you are. It may not be what you expected, but you will realize God has given you your identity for a grand purpose of which we cannot now understand. But most importantly, when you see yourself, you will find that you no longer have to pretend. You won't have to chase after phantoms or idols of self-identity, but will be content to "be what you will be" (see Exodus 3:14). At that point sin will have lost its appeal; you'll see that all sin is a deceiving mirage. Then, stepping into the light, you will be happy, and you will be you.