The bible calls David a man after God's own heart.
But God removed Saul and replaced him with David, a man about whom God said, "I have found David son of Jesse, a man after my own heart. He will do everything I want him to do."
1 Samuel 13:14 (Samuel rebukes Saul for his disobedience)
"But now your kingdom must end, for the Lord has sought out a man after his own heart. The Lord has already appointed him to be the leader of his people, because you have not kept the Lord's command."
When we take a look at David's life however it's important to see that his life was not free of troubles. David had the same highs and lows that many of us go through every day of our lives. Just as we experience ups and downs in our life, so did David. As with David I'm sure some of our downs come from our own personal sins, but as with David, some of the downs in life come from the sins of others. We can't always control our ups and downs can we? I suppose the lesson here... is that we can trust that God will help us through these trials of ours, just as he helped David through his.
David's anointed King (1 Samuel 16)
David kills Goliath (1 Samuel 17)
David Fled from Saul (1 Samuel 18-31)
Kiklag destroyed (1Samuel 30)
Crowned King over Juda (2 Samuel 2)
Crowned King over all Israel (2 Samuel 5)
God made a special covenant with him, Israel has peace (2 Samuel 7,8)
Committed adultery and murder (2 Samuel 11)
Solomon Born (2 Samuel 12)
Absalom rebelled (2 Samuel 15-18)
David restored as King (2 Samuel 19)
David sinned in taking a census (2 Samuel 24)
David planned the temple (1 King 2)
Even in the midst of trials, yes even the trials that we go through because of own own sin or weaknesses. God is still with us. It is possible to have a heart that longs to obey God and serve him, yet not always live in obedience. Simply put, we mess up sometimes, and the consequences are painful and often make us feel like hypocrites in our faith (which I suppose we are.) But the good news is that the Lord God knows your heart. He knows we struggle and he knows if you have faith. In the end... he will reward us for our consistent faith. That's good news!