Galatians 5:17 For the flesh lusteth against the Spirit, and the Spirit against the flesh: and these are contrary the one to the other: so that ye cannot do the things that ye would.
The ‘flesh’ represents our own fleshly desires.
1 John 2:16 For all that is in the world, the lust of the flesh, and the lust of the eyes, and the pride of life, is not of the Father, but is of the world.
The ‘spirit’ represents the commandments of Jesus Christ.
John 6:63 It is the spirit that quickeneth; the flesh profiteth nothing: the words that I speak unto you, they are spirit, and they are life.
To ‘walk in the spirit’ is to live by the commandments of Christ.
The war takes place in our mind when we must choose what God wants us to do rather than what we want to do.
Jesus sets the supreme example in choosing to undergo crucifixion.
Matthew 26:39 And he went a little further, and fell on his face, and prayed, saying, O my Father, if it be possible, let this cup pass from me: nevertheless not as I will, but as thou wilt.
Romans 7:18 For I know that in me (that is, in my flesh,) dwelleth no good thing: for to will is present with me; but how to perform that which is good I find not. 19 For the good that I would I do not: but the evil which I would not, that I do. 20 Now if I do that I would not, it is no more I that do it, but sin that dwelleth in me. 21 I find then a law, that, when I would do good, evil is present with me. 22 For I delight in the law of God after the inward man: 23 But I see another law in my members, warring against the law of my mind, and bringing me into captivity to the law of sin which is in my members. 24 O wretched man that I am! who shall deliver me from the body of this death?
The ‘umpire’ so to speak in this battle is our conscience.
Acts 24:16 And herein do I exercise myself, to have always a conscience void of offence toward God, and toward men.
In Christ, we must change the way that we think by recourse to the word of God.
1 Peter 1:23 Being born again, not of corruptible seed, but of incorruptible, by the word of God, which liveth and abideth for ever.
Romans 12:2 And be not conformed to this world: but be ye transformed by the renewing of your mind, that ye may prove what is that good, and acceptable, and perfect, will of God.
I hope this helps