The best way to guard your heart is to give it to God each moment of every day.
Ephesians 4:23-24 (KJV) “And be renewed in the spirit of your mind; And that ye put on the new man, which after God is created in righteousness and true holiness.”
Luke 10:27 (KJV) “And he answering said, Thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy strength, and with all thy mind; and thy neighbour as thyself.”