1 Peter 3:12
12 For the eyes of the Lord are on the righteous,
And your ears attentive to your prayers;
But the face of the Lord is against those who do evil.
(RVR1960)
Attitudes towards God determine what is in people's hearts and certainly our behavior makes God stop his gaze on us because when we act with justice and with the truth God is pleased while he does not look with pleasure when people do wrong to your neighbor.
God calls his people to obedience since just as Jesus was absolutely obedient to the will of his father, so must his children because obedience must characterize the life of each believer in order to practice the biblical principles established in his word and So we can keep them in our hearts and allow us to attract God's gaze on us