It is not a rule you must follow; it is an observation of how most native speakers vary the pronunciation depending on the following sound. If the following sound is a vowel sound, then the pronunciation is usually / ði: /; otherwise, it is / ð? /.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.