If you get arrested and need a lawyer immediately, how do you get in touch with one?

r/

Location: Pennsylvania, US.

I have never needed to contact a criminal lawyer, so I don’t have any prior relationship with one. If I got arrested and needed representation, I wouldn’t have a number immediately on hand to call. I’m guessing they don’t hand you the Yellow Pages when you’re in custody, so what would happen once I invoked my right to counsel? I don’t have any intention of getting into this situation, but I’m just wondering.