What is the purpose of sin? Why do we go through life fighting against sin?
Sin has no purpose as such; sin is simply the disobeying of God’s commandments. When we disobey a commandment of God, we sin.
God made Adam with free will. He had a choice whether he would obey God or not. He chose to disobey and by his disobedience brought sin and death upon his progeny.
Romans 5:12... by one man sin entered into the world, and death by sin; and so death passed upon all men, for that all have sinned:
Romans 5:17... by one man’s offence death reigned by one...
Romans 5:19... by one man’s disobedience many were made sinners...
1 Corinthians 15:22... in Adam all die...
The punishment for sin is eternal death.
Ezekiel 18:4... the soul that sinneth, it shall die.
Because no son of Adam can live a life without sin, God in his love has provided a way whereby our sins can be forgiven. He fathered a son through Mary, a descendant of Adam. He called his name Jesus which in the Hebrew (Yahshua) means ‘God saves’ or ‘Saviour of God’. Jesus lived a life without sin (he did not disobey any of God’s commandments) and voluntarily surrendered his life as a sacrifice to redeem those who would believe and obey the gospel that he preached.
John 10:14 I am the good shepherd...15... and I lay down my life for the sheep... 18 No man taketh it from me, but I lay it down of myself.
John 15:13 Greater love hath no man than this, that a man lay down his life for his friends. 14 Ye are my friends, if ye do whatsoever I command you.
This brings us to the second part of your question. To have forgiveness of all our past sins we have to believe the gospel, repent of our sinful way of life and be baptised by immersion in water.
Mark 16:15 And he said unto them, Go ye into all the world, and preach the gospel to every creature. 16 He that believeth and is baptized shall be saved; but he that believeth not shall be damned (condemned to eternal death).
Acts 2:38 Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins...
Acts 22:16 And now why tarriest thou? arise, and be baptized, and wash away thy sins, calling on the name of the Lord.
After baptism we are to live a new life in Christ and it is at this point that we begin our fight against sin.
Romans 6:3 Know ye not, that so many of us as were baptized into Jesus Christ were baptized into his death? 4 Therefore we are buried with him by baptism into death: that like as Christ was raised up from the dead by the glory of the Father, even so we also should walk in newness of life. 5 For if we have been planted together in the likeness of his death, we shall be also in the likeness of his resurrection: 6 Knowing this, that our old man is crucified with him, that the body of sin might be destroyed, that henceforth we should not serve sin. 7 For he that is dead is freed from sin. 8 Now if we be dead with Christ, we believe that we shall also live with him: 9 Knowing that Christ being raised from the dead dieth no more; death hath no more dominion over him. 10 For in that he died, he died unto sin once: but in that he liveth, he liveth unto God. 11 Likewise reckon ye also yourselves to be dead indeed unto sin, but alive unto God through Jesus Christ our Lord. 12 Let not sin therefore reign in your mortal body, that ye should obey it in the lusts thereof. 13 Neither yield ye your members as instruments of unrighteousness unto sin: but yield yourselves unto God, as those that are alive from the dead, and your members as instruments of righteousness unto God.
The commandments of Christ are all contained in just two.
Matthew 22:37 Jesus said unto him, Thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind. 38 This is the first and great commandment. 39 And the second is like unto it, Thou shalt love thy neighbour as thyself. 40 On these two commandments hang all the law and the prophets.
Our neighbour includes our enemies.
Matthew 5:44 But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use you, and persecute you; 45 That ye may be the children of your Father which is in heaven: for he maketh his sun to rise on the evil and on the good, and sendeth rain on the just and on the unjust.
Unless we do the will of God, Jesus cannot save us.
Matthew 7:21 Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven.
The kingdom of heaven is not in heaven but will be the restored kingdom of David upon the earth.
Luke 1:32 He shall be great, and shall be called the Son of the Highest: and the Lord God shall give unto him the throne of his father David: 33 And he shall reign over the house of Jacob for ever; and of his kingdom there shall be no end.
It will be established when Christ returns. At his return those who have obeyed the gospel will be raised from the dead and given eternal life. They will reign with Christ for one thousand years. After this there will be a final resurrection and judgment and sin and death will be eliminated. All that live on will be partakers of the divine nature and God will dwell in them forever. Paul explains what is going to happen.
1 Corinthians 15:20 But now is Christ risen from the dead, and become the firstfruits of them that slept. 21 For since by man came death, by man came also the resurrection of the dead. 22 For as in Adam all die, even so in Christ shall all be made alive. 23 But every man in his own order: Christ the firstfruits; afterward they that are Christ’s at his coming. 24 Then cometh the end, when he shall have delivered up the kingdom to God, even the Father; when he shall have put down all rule and all authority and power. 25 For he must reign, till he hath put all enemies under his feet. 26 The last enemy that shall be destroyed is death. 27 For he hath put all things under his feet. But when he saith all things are put under him, it is manifest that he is excepted, which did put all things under him. 28 And when all things shall be subdued unto him, then shall the Son also himself be subject unto him that put all things under him, that God may be all in all.
It is for this hope which is set before them that those who have been baptised into Christ fight against sin. They strive to be like Jesus in their lives so that when he returns they might have eternal life.
Matthew 7:12 Therefore all things whatsoever ye would that men should do to you, do ye even so to them: for this is the law and the prophets.
The temptation to sin comes from within us; it is not the malign influence of some external supernatural power.
Jeremiah 17:9 The heart is deceitful above all things, and desperately wicked: who can know it?
Mark 7:21 For from within, out of the heart of men, proceed evil thoughts, adulteries, fornications, murders, 22 Thefts, covetousness, wickedness, deceit, lasciviousness, an evil eye, blasphemy, pride, foolishness: 23 All these evil things come from within, and defile the man.
James 1:14... every man is tempted, when he is drawn away of his own lust, and enticed. 15 Then when lust hath conceived, it bringeth forth sin: and sin, when it is finished, bringeth forth death. 16 Do not err, my beloved brethren.
Despite our best efforts we will still sin after baptism but forgiveness is available in Christ through prayer.
1 John 1:5 This then is the message which we have heard of him, and declare unto you, that God is light, and in him is no darkness at all. 6 If we say that we have fellowship with him, and walk in darkness, we lie, and do not the truth: 7 But if we walk in the light, as he is in the light, we have fellowship one with another, and the blood of Jesus Christ his Son cleanseth us from all sin. 8 If we say that we have no sin, we deceive ourselves, and the truth is not in us. 9 If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness.
We will be judged on how we have shown the love of God to our fellowman:
Matthew 25:40 And the King shall answer and say unto them, Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me.
Matthew 25:45 Then shall he answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to me.
I hope you have found this helpful.