The apostle Paul had much to say about the "fruit of the Spirit", which he contrasted against the "works of the flesh". Consider the following two passages:
For, brethren, ye have been called unto liberty; only use not liberty for an occasion to the flesh, but by love serve one another. For all the law is fulfilled in one word, even in this; Thou shalt love thy neighbour as thyself. But if ye bite and devour one another, take heed that ye be not consumed one of another. This I say then, Walk in the Spirit, and ye shall not fulfill the lust of the flesh. 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. But if ye be led of the Spirit, ye are not under the law.
Now the works of the flesh are manifest, which are these; Adultery, fornication, uncleanness, lasciviousness, Idolatry, witchcraft, hatred, variance, emulations, wrath, strife, seditions, heresies, Envyings, murders, drunkenness, revellings, and such like: of the which I tell you before, as I have also told you in time past, that they which do such things shall not inherit the kingdom of God.
But the fruit of the Spirit is love, joy, peace, longsuffering, gentleness, goodness, faith, Meekness, temperance: against such there is no law. And they that are Christ’s have crucified the flesh with the affections and lusts. If we live in the Spirit, let us also walk in the Spirit. Let us not be desirous of vain glory, provoking one another, envying one another. Galatians 5:13-26
For ye were sometimes darkness, but now are ye light in the Lord: walk as children of light: (For the fruit of the Spirit is in all goodness and righteousness and truth;) Proving what is acceptable unto the Lord. And have no fellowship with the unfruitful works of darkness, but rather reprove them. Ephesians 5:8-11
The natural man (man being a corporate title for all mankind including men and women) is separated from God by sin. The natural man produces "works of the flesh" regularly without having to contemplate or plan them - they happen naturally. The natural man cannot produce the "fruit of the Spirit" because the Spirit of God is not operative in his life.
Only a person that has been spiritually born anew by the power of God, that is, regenerated and transformed by God through faith in Jesus Christ, can produce "spiritual fruit". Spiritual fruit arises from the new spiritual nature of believers as empowered and directed by the Holy Spirit of God that resides in them. But believers also can produce works of the flesh, especially if they are not walking in the spirit, staying close to God. In the passages above, Paul explained that believers have two natures that are contrary to or opposed to one another - one wanting to do the will of God and the other wanting to do otherwise. They vie for control of our body and thoughts. We can determine which nature, flesh or spirit, is in control by looking at the true motives for and nature of our actions, whether they be good or evil.
So, how do we "walk in the spirit" so we will not fulfill the lusts of our old flesh nature, causing us to sin. The answer is that we are to walk in love towards God and our fellow man. Love itself is a fruit of the Spirit! We can't do this by our own strength and power, but God will help us. By the power of His Spirit working in us, He will change our heart, our thinking and our desires to be in conformance with His. We will find ourselves beginning to desire and do the right things, live the way God wants us to, and loving one another and God with pure motives. Jesus said that He is the Vine and we are the branches, and that if we abide in Him, we will bear much fruit:
I am the vine, ye are the branches: He that abideth in me, and I in him, the same bringeth forth much fruit: for without me ye can do nothing. If a man abide not in me, he is cast forth as a branch, and is withered; and men gather them, and cast them into the fire, and they are burned. If ye abide in me, and my words abide in you, ye shall ask what ye will, and it shall be done unto you. Herein is my Father glorified, that ye bear much fruit; so shall ye be my disciples. John 15:5-8
Dear Heavenly Father, please teach and guide us, transform and empower us by Your Word and by Your Spirit. Help us to abide in Jesus, love one another, and lovingly walk in Your ways that we might be fruitful and bring glory to Your Holy Name. Amen.