Thunderbugs can be caught in pretty much any area where you'd normally find bugs. They're somewhat rare, so you'll likely need to check several bug-gathering spots. Look for butterflies or fireflies, which mark the places where you can collect insects—and don't forget you'll need a bug net equipped to catch them.
A helpful strategy is to craft leather armor and slot it with gathering and whim gems. This lets you pull double the items from each gathering point, gather faster, and keeps your bug net and pickaxe from breaking so easily. Once you're set up, bring five mega, normal, or old bug nets and head to the Sandy Plains or the Volcano to hunt for them.