And how do you do that? By avoiding the sorts of sins listed in the Westminster Confession-
Q. What are the sins forbidden in the first commandment?
A. The sins forbidden in the first commandment are,
Atheism, in denying, or not having a God;
Idolatry, in having or worshipping more gods than one, or any with or instead of the true God;
the not having and avouching him for God, and our God;
the omission or neglect of any thing due to him, required in this commandment;
ignorance, forgetfulness, misapprehensions, false opinions, unworthy and wicked thoughts of him;
bold and curious searching into his secrets;
all profaneness, hatred of God;
self-love, self-seeking, and all other inordinate and immoderate setting of our mind, will, or affections upon other things, and taking them off from him in whole or in part;
vain credulity, unbelief, heresy, misbelief, distrust, despair, incorrigibleness and insensibleness under judgments, hardness of heart, pride, presumption, carnal security, tempting of God;
using unlawful means, and trusting in unlawful means;
carnal delights and joys;
corrupt, blind, and indiscreet zeal;
lukewarmness, and deadness in the things of God;
estranging ourselves, and apostatizing from God;
praying, or giving any religious worship, to saints, angels, or any other creatures;
all compacts and consulting with the devil, and hearkening to his suggestions;
making men the lords of our faith and conscience;
slighting and despising God and his commands;
resisting and grieving of his Spirit, discontent and impatience at his dispensations, charging him foolishly for the evils he inflicts on us;
and ascribing the praise of any good we either are, have, or can do, to fortune, idols, ourselves, or any other creature. (WC 1:105).
Quite a list, isn’t it. Take care to be diligent to avoid them all. That way you’ll keep the First Commandment.