Paul is quoting Psalm 4:4 here.
Paul precedes the words:’Be angry but do not sin’ with the words:’Put away lying. Let every one of you speak the truth with his neighbour.’ (Ref: Proverbs 6:7)
If we are angry, it may be because of hurt pride, in which case, it is sinful. However, it may be ‘righteous anger’, and if we fail to acknowledge this anger, to ourselves, to God and to each other, we are deceiving ourselves and God and our neighbours, and giving ‘a place to the devil’ (Eph. 4:27). As Jesus said, ‘Satan is the father of all lies.’ (John 8:44)
In speaking the truth to our neighbours about our anger, and the reasons for our anger, we need to focus on ‘speaking the truth in love’ (Eph.4:15). Being angry, of itself, is not sinful. Speaking truthfully about the reasons for our anger is not sinful. Speaking with a heart of love for our listeners is not sinful.
Sadly, in my experience, no matter how lovingly and gently I may speak the truth, it is sometimes received as though I had committed an offence. I think of Paul’s words:’ Am I therefore become your enemy because I tell you the truth?’ (Galations 4:16)
Paul also exhorts his readers to be truthful about their anger as soon as possible: ‘Do not let the sun go down on your wrath.’ (Eph.4:46) Maybe this will entail being truthful with ourselves and with God at this stage. (Ref: ‘When you are in your beds, search your hearts and be silent’ Psalm 4:4).
God created us in his own image and yes, He is a God of love… but he is also a God of wrath. I have some Christian friends who really struggle with this facet of the character of God.