3 Ne 18:29 Whoso eateth and drinketh of my flesh and blood unworthily eateth and drinketh damnation to his soul
What makes someone "unworthy" to partake of the sacrament?
Romans 3:23 For all have sinned, and come short of the glory of God.
1 John 1:8 If we say that we have no sin we deceive ourselves
Who, therefore, is worthy to partake of the Lord's Sacrament?
D&C 46:4 Let him not partake until he makes reconciliation
You do not need to be perfect in order to partake of the sacrament, but you should have a spirit of humility and repentance in your heart.
Furthermore, Paul (the same Apostle who tells us all have sinned) tells us in a letter to the Corinthians that we are each to examine ourselves as to our worthiness for "Know [we] not [our] own selves, how that Jesus Christ is in [us]?" (2 Corith 13:5) We are our own judges. We should have the ability to discern for ourselves our worthiness of such things. True, at times we judge unrighteously, but that is why the atonement is so necessary.
I have wondered at times if I have taken the sacrament unworthily but taking it gives the righteous taker thereof added strength and protection throughout his week. Is it safer to not take it and pass on the potential blessing or take it and possibly have to repent of doing so unworthily? The same dilemma can be seen in temple attendance.