Let us be reminded that God is always willing to forgive us our sins and give us a new start no matter how big the sin. And God asks in return that we repent our sins and that we forgive others. (Note that there is only one unpardonable sin which is grieving away the Holy Spirit).
When we sin (and we all do!) the first thing you must do is repent, ask for forgiveness and ask God to give you strength to do that sin no more.
Another important thing is resisting temptation. From the internet I found a 3-step plan when confronted with temptation. And you can say this outloud:
1. "No! I choose not to do this sin [anymore]."
2. "Thank You, God, for the victory."
3. "I'm dead to this sin."
When you are given the power to resist temptation, always make sure to thank God for it is by his power. (Note also that it is NOT a sin to be tempted, Jesus was tempted in the dessert during his 40 days and 40 nights).
Let us be comforted in knowing that Jesus Christ died to take away our sins, the sins of the world. (John 1:29). This is his gift to all of us. Jesus loves us so much that he took the punishment for our sins. Have hope, don't get discouraged.