I built a custom PC back in 2019 and it's still great today. The only changes I made since then are replacing the 1TB NVME with a 2TB one, and upgrading to an AMD Radeon RX 7600 XT recently. Otherwise, the AMD Ryzen 7 3800X is running great.
Add in that I run Linux on it and I expect this PC to last me a very long time.
I have a 2010 iMac 27" that is nearly useless now. macOS updates ceased a while ago. I managed to get Linux on it, but even then, it's noticeably sluggish. I hate to get rid of the machine because physically it's in great shape, and I don't know what else to do with it.
It has Target Display Mode so that you can use it as a monitor.
I have one with an i7 and use it as a television.