Here are some related thoughts from part one of the catechism:
2**7 The desire for God is written in the human heart, because man is created by God and for God; and God never ceases to draw man to himself. Only in God will he find the truth and happiness he never stops searching for:
The dignity of man rests above all on the fact that he is called to communion with God. This invitation to converse with God is addressed to man as soon as he comes into being. For if man exists it is because God has created him through love, and through love continues to hold him in existence. He cannot live fully according to truth unless he freely acknowledges that love and entrusts himself to his creator.1
28 In many ways, throughout history down to the present day, men have given expression to their quest for God in their religious beliefs and behavior: in their prayers, sacrifices, rituals, meditations, and so forth. These forms of religious expression, despite the ambiguities they often bring with them, are so universal that one may well call man a religious being:
From one ancestor [God] made all nations to inhabit the whole earth, and he allotted the times of their existence and the boundaries of the places where they would live, so that they would search for God and perhaps grope for him and find him - though indeed he is not far from each one of us. For "in him we live and move and have our being."2
29 But this “intimate and vital bond of man to God” (GS 19 § 1) can be forgotten, overlooked, or even explicitly rejected by man.3 Such attitudes can have different causes: revolt against evil in the world; religious ignorance or indifference; the cares and riches of this world; the scandal of bad example on the part of believers; currents of thought hostile to religion; finally, that attitude of sinful man which makes him hide from God out of fear and flee his call.4
30 "Let the hearts of those who seek the LORD rejoice."5 Although man can forget God or reject him, He never ceases to call every man to seek him, so as to find life and happiness. But this search for God demands of man every effort of intellect, a sound will, “an upright heart”, as well as the witness of others who teach him to seek God.
You are great, O Lord, and greatly to be praised: great is your power and your wisdom is without measure. And man, so small a part of your creation, wants to praise you: this man, though clothed with mortality and bearing the evidence of sin and the proof that you withstand the proud. Despite everything, man, though but a small a part of your creation, wants to praise you. You yourself encourage him to delight in your praise, for you have made us for yourself, and our heart is restless until it rests in you.6**