Up until 4e, DnD (and TTRPGs in general) were pretty much only spread through the game itself. You either knew someone who played, or maybe you heard about it on the internet and you were interested so you sought out a local game shop, something like that. Regardless, your first experiences with what DnD was like (ignoring fear-mongering movies and other negative media) was likely to be from playing it.
That seems to have changed with 5e. DnD media is bigger than it’s ever been. Actual play podcasts and shows are everywhere. Speaking personally, though I had been in lots of LGS from playing a ton of MtG growing up, my first direct exposure to DnD was finding The Adventure Zone (way back when it first started as a “one-off” side thing from MBMBAM). From there, I learned about Critical Role, and it only took a few watches of that before I resolved to actually find a group to play with.
How about everyone else? Did you get into the game because a friend invited you to play, or did you get hooked on some DnD show and decide “I want to do that, too!”
I guess my first exposure, technically, was the gag on Futurama with Gary Gygax, Nichelle Nichols, and Al Gore. I might have seen some of the games like Baldur’s Gate before ever playing in a D&D game myself, but I don’t think I played any those games before playing for myself. Ultimately I started playing simply because a friend invited me to join a game he had just started, and it would be something to do to get out of the house, so I joined.