If the heart wanders or is distracted, bring it back to the point quite gently -- and even if you do nothing during the whole of your prayer but bring your heart back, though it went away every time you brought it back, your time would be very well employed.
The most perfectr prayer breathes in a heart that remains silent before God and knows how to listen to God.