I saw this post but wasn't sure. I guess Apple killed target display mode on both ends.No. Target Display Mode requires the Mac connected to the iMac to be from 2019 or older and be running 10.15 or earlier, which the newest Mac Minis cannot be.
Read more here: https://support.apple.com/en-us/HT204592
Helpful comment.You can't use target display mode, but there are third party equivalents that might do well enough for you and your needs. I use both Luna Display and Duet Display. Duet display being more versatile, and Luna having less latency.