This should help. The exact description may be out of date, but the basic process is the same for today’s Groovy DTHs.(Edge Drivers, of course, are installed differently.)
[OBSOLETE] FAQ: An Overview of Using Custom Code in SmartThings (SmartThings Classic, Groovy Code)