To commit sin is to willfully disobey God’s commandments or to fail to act righteously despite a knowledge of the truth (see James 4:17).
The Lord has said that He “cannot look upon sin with the least degree of allowance” (D&C 1:31). Sin results in the withdrawal of the Holy Ghost. It makes the one who sins unable to dwell in the presence of Heavenly Father, for “no unclean thing can dwell with God” (1 Nephi 10:21).
Other than Jesus Christ, each person who has ever lived on earth has broken commandments or failed to act according to knowledge of the truth. The Apostle John taught: “If we say that we have no sin, we deceive ourselves, and the truth is not in us. If we confess our sins, [Jesus Christ] is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness” (1 John 1:8–9). Through the Atonement of Jesus Christ, each person can repent and be forgiven of these sins.