Write What You Know. Surely someone's suggested you do this. As a teen, I hated the phrase because I literally thought it meant I could only write autobiographies with the names changed. Since then, I've learned a lot about what knowing something really means, and, thankfully, it's not so cut and dried.
1. Empathy and observation work. I am not a programmer or real estate agent. I've never run a marathon or installed french doors. I've never attempted suicide or adopted a child, but I know people who have. I listen to their stories enough, watch them in action, ask a few questions, and I have enough to write from their point of view. It helps if I can get inside their head enough to understand why they do what they do.
2. Research is useful and fun! Especially when it doesn't have to be accurate. One thing I love about speculative fiction is that as long as the details agree with each other, they don't have to agree with the real world. And one way to get a great group of details that sounds good on paper but doesn't need to be authentic is to look on Wikipedia. It may not be 100% reliable, but it's almost always interesting and harkens back to something that sounds plausible. Of course, accurate research is even better, but requires more effort to validate or dig up reliable sources. That's one of the reasons I avoid the type of writing that needs it.
3. My personal experience can be the mole hill for my characters' mountain. I've never killed a person, but I have experienced anger and devaluation of others that tempted me to push back. I've never run a country or a multi-million dollar corporation, but I am an adult who must juggle responsibilities and loyalties. I've never teleported my body, but my mind goes somewhere other than where I really am on a regular basis.
I think when people say you should write what you know, what they really mean is don't write what you don't know. I don't know anything about deep sea diving, Argentina, or the U.S. Justice System. Before I go writing about any of these, I'd need to do some research, talk to people who do know, and perhaps venture into experiencing them for myself. Even speculative fiction needs elements of reality to anchor it, because something needs to ring true. I don't tend to write military sci-fi because I know nothing about the real military. I haven't ventured into fantasy plots that center around political strife because I ignore real-world political strife. I do understand small group dynamics, psychology, philosophy, and religion, so my plots tend to deal with those.
What does your writing say about your knowledge base? What do you gravitate towards because you know it or shy away from because you don't?