You can buy threaded inserts (see video below ... Then he used a hot air gun to only heat the metal (so as to reduce the chance of deforming the actual part). Once it was hot (about 15 seconds ...
Threaded inserts are great for melting into FDM prints with a soldering iron. The process isn’t so simple for resin prints, since they don’t generally soften with heat. Off course, you can ...