Why don’t you start with the following, which introduces the various ways that you can control devices with SmartThings. You don’t have to write your own code, although you can if you want.
You might also want take a look at the quick browse lists in the community – created wiki. These lists are in three sections: smart apps, device type handlers, and project reports. That’s usually the quickest way to find code that other members have shared.