Just locate a wholesaler and ask if they will sell to you.
The worst that can happen is that they say, "Sorry, we don't do direct sales."
More likely, I think, is that there will be a minimum purchase requirement -- either a minimum weight or minimum dollar amount. (And buying from a wholesaler may only be possible if coffee is not subject to sales tax in your jurisdiction, as someone else has pointed out.)
If you're buying green beans, you can comfortably buy enough stock to hold you for several months. (Roasted coffee beans are best consumed within about 3 weeks of roast date. "Best Before" dates generally might tell you it's okay for many months beyond that point. But peak freshness is fleeting.)
I never buy pre-ground or even pre-roasted coffee anymore. It's not snobbery, I swear. I'm the only coffee drinker in the house, and I never get more than half way through a packet of ground coffee before it's noticably stale. )
There's a shelf life for green beans but it's orders of magnitude greater than the shelf life of roasted beans. I order green beans 2 or 3 times a year. I order 5lbs (2500 gram bags, actually) of the two bean varieties which I consume the most of (a Colombian and an Ethiopian). Then I add a few 1 "pound" (500g) bags of beans of other origins that I want to try out. Possibly a 200g bag or two of something high end - like a geisha.
I haven't crunched the numbers, but roasting/brewing at home certainly feels much more economical than brewing pre-ground beans. I enjoy much greater variety in my coffee drinks. And I actually enjoy roasting the beans. Also, I seem to have gotten better at roasting as I've gained experience.
I don't slam Starbucks or Costa - they fill a need, and I've never had a bad coffee from either of them. But my coffee journey got a hell of a lot more interesting when I started brewing V60's from single origin beans at home.
You don't have to roast your own beans to have good coffee. And, unless you're more adept that I was at the beginning, you'll likely have some sub-par roasts and brews before you get the hang of it. It suits me to roast at home in the coffee backwater in which I live. (It's only gotten worse here since Covid-19 hit. Coffee shops are now *very* few and far between. And I will no longer touch what the supermarkets have on offer.)