It is indeed a heavy task to buy a pair of good headphones and it might be expensive, too. Some headphones have an interesting price and an interesting potential, but they're just not „there“. They might be good, but there is just a tiny „something“ missing. Too bad.

Or maybe not. If you're a handy DIY-er, you can compensate bad points and improve the quality of virtually any pair of headphones. You mostly need just basic tools (a drilling machine, a bunch of screwdrivers, a soldering iron).

Rules and warnings

1. There is always a chance that you might damage your headphones by tweaking them, like desolder the coil from the membrane, damage the membrane with a screwdriver, break the chassis and so on. So, be really careful, don't hurry, work slowly and don't tweak (for your standard) expensive headphones.

2. Most probably someone has already tweaked your model of headphones and has posted his procedure and findings on a blog or forum. Do study what he did.

3. If you're not a handy type, just don't go there. Ask a technical friend to help you out if needed, still keeping in mind the first two rules.

Cable

Stock cables on most headphones are usually very (under) average. Changing the cable is the easiest and most effective approach. It is the first thing you should consider. The cables usually have two parasite components that you have to be aware of and keep them as low as possible: capacitance that makes your frequency range uneven, and resistance, which reduces the signal strength. When changing the cable do think of a good and solid jack connector.

If your cable is detachable, that's an easy job. If not, you will need to dismantle the headphones and solder a new one in.

Mechanical parts

This part is about the manipulation of a headphone chassis a. k. a. ear cup. There are many approaches possible here, like inserting a dampening material (cotton or mineral wool), drilling holes, closing open parts, etc.

These manipulations are the ones that are in some cases irreversible. I don't encourage you to go there unless someone has already done it and has proven it to be OK.

Filters

Making a headphone linear is pretty demanding for a constructor. This is also one of those parts that define a headphones' character: bright, dark, bass boosted, etc. Typically, when observing a frequency response graph of various headphones, we can see that up to 1 kHz the linearity is quite good, while above that the characteristics get bumpy.

If there are any obvious peaks (even after the cable replacement and a possible mechanical intervention), you might correct that with a low/high pass filter. Those filters consist of a RC (resistor-capacitor) or LC (coil-capacitor) link. There are plenty of calculators and tutorials online how to do that.

Conclusion

Tweaks can dramatically improve the sound of your headphones, elevating them on another level of quality, linearity and listening experience. They are worth a try. Again, be careful and first of all, see if someone has already tweaked your model of headphones.