Please don't try the intended HDD storage drive internally again until after reading. This has been a challenge for others also.  If you can't get your way in BIOS or the Boot Menu... First, a tip:  In BIOS boot options, either Windows Boot Manager should be checked off or the m.2 SSD.  With the Optiplex being a business machine, and it was bought refurb or used, there may be other boot options that need unchecking or deleting in BIOS that are related to booting from a network.  Might start with something like IPV4, IPV6, etc.  If there's things in the boot option list not described here, could you please upload a photo of it?  Next... I'd mount the HDD externally in an enclosure or dock with on & off switch.  With it off, boot your PC from the m.2 drive.  Then turn on the HDD, go into Disk Management, and use reformatting to wipe the drive.  Even if it's formatted to NTFS, reformatting it again to NTFS (and use GPT partition scheme) will wipe the drive.  It's now ready for storage. Before wiping the HDD, if PC doesn't see the HDD when powering it on, simply use Update in Device Manager. This is no guarantee that the PC might not still try to boot from the HDD once reinstalled in PC, but I don't see why it would   If that's the case, you have an external storage drive.
I have a new/old Optiplex 7060 that I recently purchased. It came with a HDD and win 11 which I removed to install a M.2 SSD I did a fresh install of win 11 on the M.2 SSD and everything was working fine till I decides to reinstall the old HDD to use as additional storage. Thats when things went wrong,the PC booted from the old drive instead of the new . I turned it off and removed the HDD and rebooted.The PC failed to recognize the  SSD at all so I tried to change the boot drive in the bios by enabling legacy mode in the hope it would give me the option of selecting the SSD. I cant seem to reverse the changes I made in the bios  and am wondering what is the best way to proceed. I have a USB recovery drive and system image back up I created after setting up if that will be of any help.
Help ,think I broke my computer