You seem to be referencing Psalm 139:8. An approved current Catholic translation of this Psalm is here:
Daily Bible Readings, Podcast Audio and Videos and Prayers brought to you by the United States Conference of Catholic Bishops.
bible.usccb.org
Note that the word used in the verse 8 is not “Hell” but “Sheol”, which was the Jewish term for the place where the dead went, prior to Jesus’ death and resurrection.
Sheol was basically an underworld where all deceased souls went, regardless of whether they had lived good or bad lives. Although some English editions of the Bible use the word “Hell” in this Psalm, it’s referring to this general underworld better known as Sheol, not to the Hell that is the place where the souls of the d
amned were sent after Jesus died.
When the psalmist is saying “if I lie down in Sheol, there you are” or in some translations, “if I lie down in Hell, there you are”, again he’s referring to this underworld where all the souls went prior to Jesus’ death. Somebody down in Sheol could perhaps still feel a connection to God, since righteous people as well as wicked people went to Sheol after death.
When Jesus died, He “descended into Hell” which means that he went down to Sheol and opened up the gates of Heaven for all the souls of the righteous who had been sitting down there in Sheol, also known then as Hell, and let them go to heaven.
From that point onward, since Heaven was now open to those whom the Lord judged worthy of it, Hell became a place of eternal punishment and complete separation from God, forever. God has no relationship with Hell.