What does it mean to be pure in heart (Matthew 5:8) and how could I have such a heart, for though I am a Christian I feel the sin in my heart and I know it is not pure all the time?
In the passage you refer to we are reading of the principles which govern those who are in the Kingdom of Heaven, that is, it is our moral standing as believers here in this world. The question of our sins is not here; we are already, as believers, forgiven and stand before God in all the righteousness of Christ. Because God is pure there must be purity of heart to appreciate Him, that is, to see Him. The thought of natural seeing is not here, but rather the appreciation in our soul of the glory and moral excellencies and beauty of our blessed Lord.
As we are occupied with the person of the Lord we are transformed from glory to glory and so our heart has a greater appreciation of His wonderful character and attributes and this effects a change in our heart to make us purer.
Now the fact that one recognizes sin and failure is a most encouraging sign of a tender conscience. We must not be occupied with the failure, but having confessed it, then be taken up with the glorious Man who has lived here in this world for the glory of God and who now has given to us the power so to live, as those who "put off the body of the flesh…buried with Him in baptism…raised with Him through faith of the working of God…" (Col.2:11-12). "If therefore ye have been raised with the Christ, seek the things which are above where the Christ is sitting at the right hand of God…" (Col 3:1). It is in this way that we will have a pure heart, that is an undivided heart. The hope of His coming also has a purifying effect upon us…"even as He is pure" (1 John 3:3).
With warm love in our Lord Jesus,