Use a sliding window. Expand the right boundary until the window contains all characters of t. Then contract from the left to find the minimum valid window. Record the smallest valid window found.
Track two things: a frequency map for characters in t, and a counter for how many distinct characters you've fully satisfied. When the counter equals the number of distinct characters in t, you have a valid window.
When expanding, decrement the needed count. When that count hits zero for a character, you've satisfied it. When contracting, increment the needed count. If it goes above zero, you've lost that character.
With s = "ADOBECODEBANC" and t = "ABC": expand to "ADOBEC" (first valid). Contract to "DOBEC" (invalid). Continue expanding and contracting. Best found: "BANC".