How do you pronounce the letter "t" before "h"?

The correct answer is really that you should pronounce both words as you would in any other context. However, you will hear a difference in regional dialects, and also it is natural for any native speaker to speak quickly and run words together which can result in some letters being dropped or at least under-pronounced.

When a word ends in a consonant sound, we often move the consonant sound to the beginning of the next word if it starts with a vowel sound. So, "what happened" may sound more like "wha-tappened?"

"Dropping" 'T's (T-glottalization) is a fairly common thing and in accents affected by this you may not hear the 't' sound in "what" in any context. Similarly, dropping 'H's occurs in some dialects so your phrase in question may even sound like "wha' 'appened?"

Prouncing "T" as "D" (as in "whaddup?") is also present in some dialects, particularly American accents.

Over-pronouncing the 'T' in "what happened" would stem the flow of natural speech so it may be under-pronounced by many. It will be present, but not as pronounced.