If one of the sets is empty, the conclusion is trivial. So, suppose neither is.
Since K and L are closed and X is compact, then K and L are compact. And since they are disjoint, the distance δ between them is positive.
For every k in K, let Uk be the open ball of radius δ/2 and center at k; and for every l in L, let Vl be the open ball of radius δ/2 and center at l. Then, for every k and every l, Uk and Ul are disjoint. Put V = ∪ Uk, k in K, and U = ∪ Vl, l in L. Then, U and V are open and, by construction, K ⊂ U, L ⊂ V and U ∩ V= ∅.