There are some noise reducing headphones (like Airpods Pro or Sony Wh-1000xm*) which have ambient mode - mixing music with external noises which also work great for that scenario.
As far as anything like an earbud goes, I don't know if the shape of my ears is a bit unusual, but I cannot run with anything like an earbud without having the earbud slip out frequently. I need something like a headphone to avoid having to constantly fidget with my ears.
Just my personal experience.
Just yesterday I ran 21 miles and listened to 3 podcasts while doing so. Afterward the headphones still reported a battery level of "high".
Sure you don't get amazing music quality, but it's good enough for the distraction and I always hear every bicyclist approaching me from behind.