I would strongly recommend you contact an Apple Authorized Service Provider, not an Apple Store as they do not offer that service, to remove the hard drive: Get Support. Removing the drive is an extremely difficult procedure that is not supported by Apple.
You can then restore the files to your new Mac once the old hard drive has been removed: Restore your Mac from a backup - Apple Support.
Once your new Mac is setup with your data migrated, you should setup Time Machine again to keep continuous backups of your data and never risk it again: Back up your Mac with Time Machine - Apple Support. If you do not have a Time Machine backup drive, here’s an excellent one sold by Apple: G-Technology 4TB G-DRIVE mobile USB-C Portable Hard Drive - Apple. I would advise against using the old hard drive from your previous iMac as your backup drive as it is most likely old with imminent failure.
Also, moving forward, I recommend that you use iCloud in addition to Time Machine to sync all your files and photos to all your Apple devices. Although iCloud is not a "true" backup service, iCloud can also act as an emergency off-site backup, but this is why iCloud should be used in addition to Time Machine. Here are some resources on setting up iCloud for Mac:
Cheers,
Jack