James is a book that many of us know random verses from, yet we tend to not really know the book that well. Part of the reason for this is that James is like Proverbs in that many of its verses really stand alone in their content. Many subjects are handled quickly and succinctly in the book. In James 4 there is a logical progression throughout the chapter, while still allowing some verses to cover individual topics.
As we look at this chapter, it is important to remember that the book of James is written to Christians. In the book there is an assumption that the reader has already yielded his life to Christ for salvation and is indwelt by the Holy Spirit  of God.
Before looking at the chapter in detail let’s look at the progression of the chapter in a quick summary. Allow me to paraphrase the chapter. My purpose is to show you the logical progression. I am not attempting any kind of accurate translation.
You lust and desire to have things you think are best for you, but the result is war and fighting. This is because you do not ask appropriate things from God. And, when you do ask, you ask for the purpose of your own lusts and desires. You are going around in circles by either not asking or asking outside of God’s will. You have these desires because you have become a friend of the world.
However, God still loves you and desires to draw you closer to Himself. He does this when you become humble and ask Him to cleanse you. This humility comes through the Holy Spirit controlling your actions. Don’t allow pride to make you think you are above the law and beyond God’s reach. Humility will cause you to include God’s will in your future plans.
Finally, it all boils down to doing what you know is right according to God’s revealed Word. When you don’t do what you know is right, then you are sinning against God.
Here are some of the topics covered in the chapter.
The author is teaching that humility and friendship with God are the way to draw closer to Him. When you are close to God you have Spirit-led desires. However, without this humility and a spirit-filled view of how your life should be lived, you are full of the desire to have more to consume for your own purposes. This is a common theme throughout the Bible: the Creator has been discarded so that worship and idolization of the creation becomes more important (Romans 1:25).
In this chapter the writer is speaking of a war . It can be a physical war, but I believe he is talking about a spiritual war. This is the same war that Paul wrote about in Romans 7. Within the Christian is God’s Holy Spirit and man’s sinful nature. God tells us that we cannot serve two masters. We will always ignore one to attend to the other. When you allow the lusts of the flesh to control you, then you become a lover of the world and an enemy of God.
Pride and Humility
While it is easy to let the flesh control your desires and actions, God will draw close those who humble themselves and yield to the Spirit’s control. Not only does humility bring a closeness to God, but there is an accompanying grace with this action and attitude of yielding to Him. A grace that helps us look at our lusts, that were so consuming before, as being petty and selfish.
How do we humble ourselves? Draw close to God. Confess your sins and receive a cleansing of heart and mind. Your uncertain double-mindedness (James 1:5-8) will be put away. Stand before God in the righteousness of His Son and He will lift you up. Don’t speak evil against your fellow believers. This shows you are putting yourself in the place of the law and are not humble before God. It is God’s responsibility, through the Law, to judge others—not ours.
Yielding to God’s Will
A practical way to humble yourself before God is to include Him in your future plans. These closing verses do not say it is wrong to make plans, but that those plans should include God’s will. Seek to know His will. There are times we don’t have any idea of what His will is. That is fine, but be humble and flexible enough to allow God to change your plans as He leads.
The writer concludes the chapter with two accusatory verses. He says his recipients are not humble before God. They have, at this point, continued in their pride and lusts. But, they have been told the truth. They now know what is right and have to make a decision. If they continue in the path they are currently on and do not heed God’s teaching, then they have willingly chosen to sin.
Your Current Reality
Have you humbled yourself before God in the most important decision of your life? That is, placing your faith and trust in God’s gift of salvation through Jesus Christ. That is the first step in the battle between the flesh and the Spirit. You must have the Spirit of God in you to win this battle.
Once you have Jesus Christ  as your Savior, and therefore are indwelt by the Holy Spirit, it is time to yield to this Spirit’s leading. Yield daily to God’s will. Allow His Spirit to guide you in your daily plans and actions.
Here are some related articles that might interest you:
YouTube video “Humble thyself in the sight of the Lord”