Step 1: Understanding the Concept.
This is a direct-to-indirect speech conversion question. Whenever the reporting verb (the verb that introduces the quote, like "said") is in the past tense, three things change together: the verb tense inside the quote, the pronouns, and any time expression tied to the moment of speaking.
Step 2: Key Rule to Apply.
Because "said" is past tense, the verb inside the quote must move one tense further back: simple past ("did") becomes past perfect ("had done"). At the same time, "I" (the speaker, Suresh) becomes "he" since we are now reporting his words from outside, and "yesterday" becomes "the day before" because the day of reporting is not the same as the day the action happened.
Step 3: Detailed Explanation.
Apply all three changes to the original sentence "I did it yesterday":
Pronoun change: "I" becomes "he."
Tense change: "did" (simple past) becomes "had done" (past perfect).
Time change: "yesterday" becomes "the day before."
Putting these together gives: "Suresh said that he had done it the day before."
Checking the other options against these three rules: "Suresh said that I did it yesterday" fails the pronoun and time changes. "Suresh says I did it yesterday" and "Suresh says that he did it the day before" both wrongly keep the reporting verb as "says" instead of "said," so the tense inside cannot stay in simple past either.
Step 4: Final Answer.
Only the sentence that shifts the pronoun, the tense, and the time word together is grammatically correct: "Suresh said that he had done it the day before," which is option (D).