We were faced with just this issue recently. And solving it is harder than it sounds. Assuming that you're starting from the lovely Hachikō Memorial Statue, here are your immediate options:
Double Tall Coffee Bar- 6 minute walk (Google Map link)
We're big fans of this teeny coffee stand, and it's saved us on multiple occasions. There's another Double Tall option which is also close by, a 9 minute walk from Hachikō. This is a sit-down cafe, with Wi-Fi and might be somewhere that you want to stop and hang out. But look, the bar is 3 minutes closer, making it a slightly better option.
About Life- 7 minute walk (Google Map link)
Another grab-and-go coffee stand, About Life is one of the Onibus Coffee Roasters outposts in Tokyo, and one of our favourites.
The coffee's great and they're open late. Plus, there's sake next door.
Streamer Coffee Company- 9 minute walk (Google Map link)
Known for latte art, Streamer now offers a huge variety of coffee and milk-based options, including some wonderful seasonal sakura specials. There are now a lot of Streamer outlets now, but this closest one could be your saviour if you need somewhere to sit down and relax.
Fuglen- 15 minute walk (Google Map link)
A sit-down cafe and bar, Fuglen is a lovely spot to relax, but it can get really busy. If it's too packed, consider snagging a takeaway and wandering through Yoyogi Park.
There's another Fuglen close by, where they roast and sell wholesale and retail beans. The labels are on point and these make great gifts for the coffee lover in your life.
Mojo Harajuku- 19 minute walk (Google Map link)
NZ coffee stars Mojo now have three Tokyo outposts, and counting. If you're
craving a flat white and perhaps a pastry snack, it's worth hiking over to Harajuku.