This happens to me, too. Sometimes for very good reasons, such as I've been too busy during the day, or I've been worried about something I couldn't do anything about, or have gotten upset about something, or at someone, and I can't get rid of my anger.
What seems to help me is to spend some time thinking through what's on my mind, and then bring it to God in prayer. He knows the struggle I have. He knows my weaknesses and my sins. He will show me either that I've been wrong, that I am not trusting Him, or that I need to deal with an issue I have not wanted to
Sometimes I get my Bible and I read some of God's words of comfort and hope. He usually reassures me that His love for me never changes, that I truly need Him to deal with issues and people properly.
He always calms my soul and brings me to trust Him more, and I then I am finally able to rest.