Heb4:16, 1Sam13:14, Act13:22, Ps42:1-2.
Just in case you mess up or fail to live up to the standards as a Christian at a point in your life, don't shy away from God because that's when you most need grace and mercy to rise again. As we are not perfect even so was David, but he knew the essence of grace and mercy so he ran after God consistently instead of running away from Him anytime he failed.
It will interest you to know that long before David grew up to become King, God had already declared him a man after his own heart, when he asked Samuel to anoint him for the Kingship. God also elected us to be after his own heart the day we accepted Christ as our Lord and saviour. Hallelujah!
Brethren, God sees us who are in Christ as people after his own heart. This is our motivation to draw much more closer to God. May you never loose the sense of being loved by God even when you fail. Shalom.