Installing an old OS on USB using a new iMac
I'm using iMac 2017 with Big Sur OS installed. I'm trying to prepare, a new SSD HD formatted Mac Extended Journaled, for my daughter old MacBook Pro 2012 to replace its HD. When I download Yosemite, it doesn't allowed to install it in my app folder since my iMac will not allow. Is there any other way to get prepare this HD?
Thank you in advance.
iMac 21.5″ 4K, macOS 11.7