When the is followed by a vowel sound, it is usually pronounced /ðiː/ (dhee), so that the e sounds like the ee in see or fee.
When the is followed by a consonant sound, it is usually pronounced /ðə/ (dhaa), so that the e sounds like the a in comma or the u in sum. However, the vowel is sometimes so short that it is barely noticeable (dh).
There is an exceptionare some exceptions though. When the is stressed for emphasis, it is usually pronounced /ðə/ (dhaa), regardless of the sound following it. However, in some dialects, it is usually pronounced /ðiː/ (dhee). It is also acceptable, though uncommon, to use any of these pronunciations when another would normally be used.