The pasuk states (Devarim 31:17): “And you will say on that day: Because G-d is not in our midst we have found all these bad things. And I will surely hide My face…” The Meforshim ask that saying that “Hashem is not in our midst” seems to be a form of admitting and regretting our sins. If so, why will He hide his face from us?
Sefer Gedolos Hatzadikim quotes Rav Menachem Mendel of Vorka zy”a as answering with a parable of some children who were playing. One of them hid in a hiding place and called to his friend to try to find him. If the friend is smart, he will follow the voice and thus find his friend. So too, when Hashem hides from us, He calls out and says, ‘I will hide My face…” If a person is smart, he will follow this holy voice to find Hashem.
