We too often consider the Divinity of Jesus and overlook his humanity.
Jesus was and is a man, certainly he was no ordinary man. As a man his humanity would have the same desire to sin as does any other man.
Jesus baptism was; as is ours, a signification of rejection of that nature in favor of the new Righteousness inherited at salvation. In short Jesus the man was signifying that:
the human cannot break the bonds of sin without the intervention by the blood of salvation
As a man he was rejecting that sin nature and accepting the grace of God. Put another way Jesus the man was rejecting the World in favor of Heaven.
Remember that Jesus was in the flesh;
John 1:14 KJV
And the Word was made flesh, and dwelt among us, (and we beheld his glory, the glory as of the only begotten of the Father,) full of grace and truth.
Luke 24:39 KJV
Behold my hands and my feet, that it is I myself: handle me, and see; for a spirit hath not flesh and bones, as ye see me have.
We also need to remember what Jesus said to Peter:
Matthew 26:41 KJV
Watch and pray, that ye enter not into temptation: the spirit indeed is willing, but the flesh is weak.
The reason Salvation works is because Jesus was an acceptable Sacrifice. By that what I am alluding to is When God had the nation of Israel choose a sacrificial Lamb; he required that it be perfect, or that is without blemish.
In the case of Jesus he had to be sinless in order to be without blemish. Being without sin means that he never disobeyed the Father, which Jesus did even to the cruel death on the cross; but it goes beyond that in that if he were to be without blemish meant he would have to be the in same state as man was when God breathed the breath of life into him in the beginning:
Genesis 2:7 KJV
And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.
That man had never disobeyed God.
So how did Jesus get back to that state? The answer to that is he did it just the same way you and I do.
(Keep in mind this fact that it is not the knowledge of good and evil which made man unacceptable to God, it was the desire brought on by that knowledge.)
Baptism is the burying of the old sin nature and reverting to the original sinless nature of the man originally created by God in the beginning. This is possible because it was the act of disobedience of Adam and Eve which made them unacceptable to God.
Let's take a look at some Scriptures which may clear this up:
Genesis 2:25 KJV
And they were both naked, the man and his wife, and were not ashamed.
They were not ashamed because they did not have the desires of the flesh. When God came to the garden in the cool of the evening Adam said:
Genesis 3:10 KJV
And he said, I heard thy voice in the garden, and I was afraid, because I was naked; and I hid myself.
God knew immediately that they had sinned, because up until this time they had been naked, but now the nakedness of Eve had caused a desire in Adam, which God knew stemmed from the sin nature.
Genesis 3:11 KJV
And he said, Who told thee that thou wast naked? Hast thou eaten of the tree, whereof I commanded thee that thou shouldest not eat?
And so the human part of Jesus, just as you and I: must reject that sin nature and once again be acceptable to God.
However in our case we have more to do than Jesus did, in that we have acted in that sin nature, and must therefore Repent of that sin, by repent what that entails is to reject that sin nature inherited through the flesh and also to totally regret having disobeyed God in the first place and the important part is to try as hard as we can not to sin again. And when we do sin again, remember these Scriptures:
1st John 1:9 KJV
If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness.
Mat 18:21 and 22 KJV
21Then came Peter to him, and said, Lord, how oft shall my brother sin against me, and I forgive him? till seven times?
22 Jesus saith unto him, I say not unto thee, Until seven times: but, Until seventy times seven.
However we must keep in mind that we must first be truly sorry for our sin, and ask his forgiveness each and every time we sin.