In English we express location using words such as in, at, on and by.
In Turkish the locative case suffix is used to express location.
The locative case suffix is DE and is added to the end of a noun.
|in the park
|on the table
|by the river
The suffix DE obeys what we will call suffix consonant harmony, which determines whether the first consonant in the suffix is voiced or voiceless depending on the voicedness of the letter that comes before it.
If the sound before the suffix is voiceless the suffix starts with a t. If the sound before the suffix is voiced the suffix starts with a d.
A sound is voiced when our vocal cords are vibrating while producing the sound. You can feel whether your vocal cords are vibrating by touching your throat while producing sounds.
All vowels are voiced. Beneath you can see which consonants are voiceless and which are voiced.
Actually, ğ is not voiced, but because it extends the sound of the preceding vowel, it behaves as a voiced consonant.
In the table at the top park ends in a k which is voiceless and therefore we added ta,
while ev, masa and nehir all end in a voiced sound and therefore we added dE.
A mnemonic device to remember all voiceless consonants is the sentence Fe PaŞa ÇoK HaSTa, which contains all voiceless consonants.
Meanwhile, remember that all vowels are voiced.