How does lube work?

Me & my partner have never really had problems with our sex life, but I’m 22 weeks & ever since I was about 14 weeks I just can’t get wet as I use to. I’ll get really aroused & in the mood, but still nothing. My midwife said this is a normal thing but it totally sucks. We’ve never had to use lube before, so I was just wondering how it works? Do I just put some on his thing & it helps slide it in easy? Do I put it on both of our parts? It’s safe to go inside?? It won’t cause an infection of some sort or throw off you ph balance? I have so many questions lol