Do not let the sun go down on your wrath, is a command that keeps us safe from falling into the trap of the devil. The reason we are told to do this is because of the preceeding verses.
Eph 4:21Surely you have listened to him and have been taught by him, since truth is in Jesus. 22 Regarding your former way of life, you were taught to strip off your old nature, which is being ruined by its deceptive desires, 23to be renewed in your mental attitude, 24 and to clothe yourselves with the new nature, which was created according to God’s image in righteousness and true holiness. 25 Therefore, stripping off falsehood, “let each of us speak the truth to his neighbor,” for we belong to one another. 26 “Be angry, yet do not sin.” Do not let the sun set while you are still angry, 27 and do not give the devil an opportunity to work.
We are told to clothe ourselves with our New Nature which was created according to God’s image in righteousness and true holiness. Those who have truly trusted in Jesus have a new nature, the nature of God. It all goes back to the cross of Christ where we died with Him and have been risen with Him. We have received a new nature, born again from above, a new creation in Christ. This is why we forgive, because we are children of God through the cross of Jesus. As He is, so are we in this world. It is essential that we understand what God did through the cross. We have died to sin, our old passions and fleshly activity. It is no longer we that live but Christ in us. The foundation of our new life in Christ, is our death and resurrection in our union with Him. We have the power in Christ to tread over all the power of the enemy. We can freely forgive because the mercy of God has been shown to us in Jesus. Freely give, for freely we have received.
We died with Christ and through that we have died to the ways of this world. So let us put off bitterness and show love to those that hate us and do evil to us. For we are sons and daughters of God, in Christ.