SD cards wear out under constant writes from databases and logs. On a Pi 4 or 5 you can boot from a USB or NVMe SSD for much better speed and reliability. Use Raspberry Pi Imager to write the OS to the SSD, then set the boot order.
sudo rpi-eeprom-update # make sure the bootloader is current sudo raspi-config # Advanced Options -> Boot Order