Headphones and earbuds vary wildly in price, from less than £20/$30/AU$50 to over 100x that. The answer on how much you should spend really depends on whether you go for a wired or wireless model, how serious you are about sound quality, and ultimately what you can spend or feel comfortable spending.
Typically nowadays, wireless headphones tend to be pretty universal on the features front, with active noise cancellation (ANC) and 20-hour+ battery lives spanning budget and premium price points. So what you're paying for is differences in sound quality and, in the case of Apple headphones for example, proprietary technologies that aim to enhance headphone listening and use beyond the necessaries (think Apple's spatial audio and audio sharing, say.) You can pick up a pair of decent-sounding wireless headphones or earbuds from about £100/$100/AU$200 or £60/$80/AU$120 respectively – we haven't come across many highly recommendable pairs below those figures – but the premium space comprising models costing around two or three times that is where you'll find not necessarily better-featured pairs but significantly better-sounding ones.
As for wired headphones, even (good) budget pairs can contend with the sound quality of mid-to-premium wireless headphones. If you're spending north of around £200/$200/AU$350 on a pair, we'd highly recommend partnering them with some sort of external DAC if your source is something like a phone or laptop to ensure you're getting the most out of them.