Using Old iMacs As Display For Laptop

Not really.

Apple used to have a feature called “Target Display Mode” which would do this, but it’s no longer supported.

Source: Use your iMac as a display with target display mode - Apple Support

Target display mode requires macOS High Sierra or earlier on the iMac used as the external display. It does not work with macOS Mojave or later.

The only option that I am aware of is Luna Display, but it requires that macOS be running on the iMac, so if the iMac itself dies, it will no longer work.