The word has three standard pronunciations, which vary by context. The definite article ‘the’ is normally pronounced /ð?/ before a consonant sound and /ði/ before a vowel sound.
Neither of these is a stressed syllable. However, it also has a ‘stressed’ pronunciation used for emphasis, which is always /ði?/ no matter what sound should follow it. The vowel here is held longer than in the unstressed version.