There are many accounts of people who harbored Jews during WWII, hiding them in basements and attics and other places where they would be a little bit safer from the Nazis. How did the people providing these spaces connect with the people who needed them, given the secrecy that both needed to actually pull this off?
The short answer is: It was possible because of large networks of underground activists who put themselves on the line in order to help save others. Most of my knowledge comes from the Netherlands, as that's where my focus is, but the general idea is the same throughout Nazi-occupied Europe.
The best published, easily accessible work that I can immediately think of would be Corrie Ten Boom's The Hiding Place. In it, she recounts many of the ways that her network of underground activists in the Dutch city of Haarlem operated. Importantly, a lot of this was done in a way that we might more normally associate with organized crime - lots of "introductions" using intermediaries that both parties trust when two people don't know each other, lots of secret codes showing passersby whether a particular place was "safe" or not (here I mean things like a specific lamp being on, or an otherwise innocuous symbol placed in a window, etc.). Because of the web-like nature of such networks, even knowing a single person who was involved would give a Jewish person seeking assistance access to a large group of people - most of whom they don't know - who are willing to help them. Because all of this had to be done in, more or less, secrecy, it made the entire process very, very dangerous of the people involved. Ten Boom, for example, was eventually found out and sent to the military prison in Scheveningen (near The Hague), then to Kamp Vught (a.k.a. KZ Herzogenbusch, one of the two main camps in the Netherlands) and finally to Ravensbrueck.
Another work, also dealing with the Netherlands, is Miep Gies's memoir. You might recognize the name, as Gies was one of the helpers of probably the most famous Jewish person who went into hiding in all of Nazi-occupied Europe, Anne Frank. In her memoir, Gies also recounts how her husband Jan (in Anne's diary, Jan was renamed Henk to protect his anonymity) worked with the resistance and how Miep went about providing what help she could. Again, as with Ten Boom, a lot of this was a reliance on informal networks of people in which introductions by a mutual contact played a very important role.
Another scholar you might want to check out is Marten Duering. His research focuses on these networks, how they operate, and the dangers the people involved faced. I'm not sure what your native language is, but Duering's work is, mostly, in German, although he has published some things in English. On the page I linked, there is a video of a talk he gave describing his research on these networks that you might find interesting. I got a chance to hear a talk he gave about a year ago and it was very enlightening. Happy reading!