I have found McMaster.com invaluable for fasteners like this, and do not suggest horsing around with a local hardware or even big box store. If you’re unfamiliar with that site or its app you’re in for a treat - they have EVERYTHING, they will sell in small quantities without screwing you for shipping costs, and their indexing system is brilliant.
You might also find a friendly Fastenal store in your neighborhood. But the ones I’ve visited have never been friendly.
Also priceless: a cheap Harbor Freight tap and die set to confirm (and sometimes clean up) thread pitches, and a micrometer to ascertain bolt diameters. You can spend hundreds of dollars on each of these, if you want, or about $20.
I spent decades looking for replacement screw-on plastic knobs/balls for the ends of my ancient throttle and shift cables, with no luck. McMaster had them in beautiful stainless (listed as forklift control knobs) and they arrived the next day.