I've got some TNT and a way to set it off, but I'm scared I might destroy precious minerals like diamonds, redstone or gold. Is there a way to set it off, but in a safe way? I know water stops it but then the TNT wouldn't do anything.
If by a safe way you mean one where the TNT wouldn't destroy valuable resources, then no.
TNT is somewhat impractical for mining, because only about 30%-ish of the destroyed resources actually drop as items (wiki). So if you don't want to risk destroying diamonds and such, don't use TNT — at least when you're deep enough for the resources to occur.