Writers are sly. You have no secrets from them. They snoop and eavesdrop with no shame. I think of Henry Higgins transcribing Eliza's conversations while unobtrusively leaning against a column in Covent Gardens. She only knows he's there when someone uninvolved warns her.
Damon Knight once said that the best dialogue was like a conversation you'd strain to overhear on a subway. The operative word there is "like." Most literally transcribed conversations are tedious, lacking context and full of false starts and meanders. But the sounds of good dialogue are all around you. Regularly paying attention and noting what you've heard (and why it is interesting) will naturally feed your stories and make them authentic. As long as you don't get to literal.
A word about eavesdropping. Don't get caught. Don't cheat, either. Most man-on-the-street interviews are deadly. Too many people scramble to sound reasonable on camera and grab the tired phrases they've heard on the news over and over again. And the creative editors in the news room seem to gravitate toward these, avoiding colorful language that might create risk. Stick with the familiar.
Even worse is what comes across in reality shows. That dialogue seems to be processed with malice aforethought. Talk shows? Blather. The attempts at conversation are grabs attention, not true communication.
So go to the mall. Go to a courthouse. Go to a ballgame. Go where people are relaxed and with friends. Or adversaries. One reason to hang around a long line of people trying to get a great price, get the best tickets, or be in position for festival seating is to hear them talk, especially when someone tries to jump the line.
Of course, if you know what your are writing and need to hear how teens or professors or cops talk, to do research, go where they are. If you don't fit in, don't draw attention to yourself and stay long enough so the people become acclimated to you. Seek out opportunities. Most communities have ride-along programs where you can sit in the back of a police car as the officers do their jobs.
When you interview people, pay as much attention to how they say things, the words they choose, as you do to the content of their answers. (It's a good idea to pay attention to body language, too. And I like to interview people while they are doing their normal work.)
It is helpful to listen with a purpose from time to time. Isolate cadence, vocabulary, logic, emphasis, and accent. Look for patterns in evasion, going silent, or interrupting.
Acting lessons can help you to uses of dialogue, to sharpen your observational skills, and to learn the power of a pause. Improv training can get you to listen and respond quickly. It gives you chances to surprise yourself.
Tape voices and get them into your head. Then create new things for your subjects to say.
A lot of dialogue in stories is facile and cliche. You would never want to overhear it. If you want authentic dialogue that causes people to lean in to catch every work, you need to put in the time and effort preparing to write it.