Well you could spend years learning computer electronics, reverse engineering, and low level Windows programming and write your own drivers (I'm kidding unless you're really smart).
Stocking up on compatible parts is what I've been doing for the past few years.
However there is the huge issue of eeprom/flash memory bitrot looming ahead.
Most 1995 and later motherboards, cards, harddisks, and probably most CPUs use eeprom/flash programmed at the factory with firmware and/or programmable logic. In a cool environment, most eeproms will keep the programming 20 to 100 years. Inside a warm computer, maybe 15 to 30 years.
These are chips where an end user has no ability to reprogram them (plus you need the code from a good one), and most are one time programmable so you'd need blank replacements, and there's the roadblock that they're surface mounted (25mil pitch, BGA, etc.) and near impossible to replace without specialized equipment and skills.
I use a 1995 era Keypro keyboard (clicky). I bought every one that went up for sale on eBay for years. I managed to get ten or so in my collection, and only one still works (the one I'm using now). It will be a sad day when it dies. I do have the skills and equipment to create a replacement keyboard microcontroller, just no time to do so (and I'm recovering from a stroke that nearly killed me).
I have a box of dead hardware, some failed obviously from eeprom bitrot. All 5 of the vintage Onkyo Integra cassette tape decks I bought have died in the same manner- turn one on and it randomly flashes LEDs, start/stops the motors, record playback heads extend and retract, etc. One I bought new in the 80s, the rest from are from eBay. Most of my harddisks from 1995 to 2003 no longer work. Most likely use eeproms in some fashion.
My Logitech Trackman Marbles (T-CH11 circa 1995) may also suffer the same fate. It's using a PIC microcontroller, and the ones from that era I have years of experience programming and using. I know the windowed one is eeprom (so you can erase it with UV light), but not sure if the one time programmable ones are eeprom or fuses. Fuse programming lasts forever, but eeprom and flash took over due to the higher data density.
All the Marbles still work (I have about 20) and I need to see if I can read the firmware from one (to be used to program a new one). The PIC has a code protect bit, so if Logitech used it, then it's not possible to read the firmware (unless you have some special solvent that dissolves resin plastic, an electron microscope, nano-probes, and the skills...).
Besides the keyboard and Marbles, the oldest gear having eeproms is my Windows 2000 box, a P4 from 2002. It may die soon (it began freezing randomly about a year ago, I recover with Acronis). No software on it has changed in 10 years, so it's hardware related.
The issue will become well known among collectors and users of vintage gear soon.