Every time I've tried to use a pi as a long-lived server, the SD card ends up getting corrupted. Switched to a chromebox running kodi for my media server, running 24/7, five or six years ago and haven't had a single problem with it.
SD card corruption is a big problem with the Pi, but its easily solved: enable the read-only overlay for your boot/root filesystems. This is built into the RPI OS. start raspi-config, and go into performance options.
Every month or two, disable the overlay (again using raspi-config), reboot, apply updates, re-enable the overlay, and you are good to go.
Also, if you are using a PI4, switch to booting from a USB stick and just forget about the SDcard.
I had trouble with that on the original models, even with a good (or at least official) power supply (many reported the issue was worse with cheaper USB power sources).
Never had trouble with the 3 that was a Kodi box and latterly has been used for some electronics experiments, the 4 that is my current Kodi box, or the 400 that has been playing as router+firewall+VPN since early this year (at the time getting a 3 or 4 for the job would have been either expensive or near impossible, and I didn't want to try a potentially less well supported option, but I spotted a nice offer on a 400).
In addition to the other helpful suggestions you’ve received, look into using Log2Ram. It does what it sounds like, puts log writes in ram and then writes them to disk on a slower cadence that doesn’t work your SD card that much.
If you have a workload that writes data quite frequently, then moving that data off to an external SSD is also a good way to extend the lifetime of the SD card.
That's true, I forgot that was a feature they supported with the newer Pi-s. Doesn't work for Pi 1, you can move the root partition to the SSD, but anything needed for the initial boot still has to live on the SD card.