"The pasta is without milk."
They said that when we put (the) before the word we put (yi) to the Turkish word
That is not true in general - only if the word is a direct object!
For example, "the bread" in "I eat the bread" -- it is the direct object of "eat".
But "the bread tastes good" -- there "the bread" is not a direct object but a subject, so it does not get marked with the accusative case in Turkish.
Also, the accusative case marker is not always -yi -- it can be -i -ı -u -ü -yi -yı -yu -yü, depending on the last syllable of the word.