"I have a 512gb storage on the machine but want to use my new Samsung T7 2TB SSD as the storage to boot from"
It would help if you told us WHAT YEAR the iMac is.
Is it new enough to have USBc ports on the back?
That would make it either 2017, 2019, or 2020.
With that said...
If you have a relatively newer iMac with USBc, and IF it has a factory-installed SSD inside, IT DOES NOT MAKE SENSE to boot it from an external drive, even from an external SSD.
REASON WHY:
The internal SSD is [probably] much faster than will be an external USB3.1 gen2 SSD (which has read speeds around 910MBps).
What you need to do to get more information:
Download the FREE "Blackmagic Disk Speed Test" utility from the App Store.
Use it to test the speed of the internal SSD.
Measure this against the speed I gave you above for an external USB3.1 gen2 SSD.
There was a time (back in the days of platter-based internal drives) that it made sense to boot and run the Mac from an external SSD. I was a big advocate of doing things that way in this forum for years.
In fact, I did it myself for SIX YEARS with my 2012 Mini.
But with the advent of fast internal SSDs on Macs, that no longer is "the best way".
If you need more than 512gb storage, by all means buy an external SSD.
But keep booting/running from the internal.
It will probably be much "snappier" that way.