"I am thanking your cook."
Translation:Ich danke deinem Koch.
"Ich danke Ihrem Koch" would also be a correct translation of the English sentence "I am thanking your cook". "Ich danke ihrem Koch" (I am thanking her/their cook) would be wrong, though. "Ihrem" has to be spelled with a capital "I" to mean "your", otherwise it means "her" or "their".
With "ihrem" in lowercase, it means "her" or "their," not "your." Remember that the lowercase-s "sie" means "she" and "they." You must capitalize it as "Sie" to be the formal "you."
You also may be thinking of the informal plural "you," which would be the variants of "euer" depending on gender and case, not "ihr" with a suffix added to it.
Some sort of correct thought process (at a beginner's non-fluent stage) might be:
The three "you" words are, in nominative case, du, Sie, and ihr. The related possessive pronouns are, respectively, "dein," "Ihr," and "euer." Then you need to decline this to neuter gender, dative case (neuter because Koch is neuter, and dative because you're using "mit"). So the neuter datives are "deinem," "Ihrem," and "eurem."
The abstract process is: 1. Determine the pronoun to use in nominative form 2. Turn pronoun into possessive 3. Adjust #2 for gender and case.
I think one thing that gets people confused is that the possessive form is genitive, so people think, "Why do I have to decline this as in #3 when it's already declined to genitive?" I know that was my thought process until I made sure to think of them as possessives and not thinking of them as genitives.
But consider a sentence like "I drink his beer." Here, you have the possessive (genitive) appearing as part of the direct object (accusative). So in German you'd have to take "him" (er), make it possessive (sein), and then decline it to be neuter (since Bier is neuter) and accusative: sein. "Ich trinke sein Bier."
Another. "I am with her cat." She - sie - ihr - ihrer. "Ich bin mit ihrer Katze."
Or you shortcut by having the possessives committed to memory: mein, dein, sein, ihr, unser, euer, Ihr. Then declining them is easy because mein, dein, and sein are exactly the same except for the first letter (m/d/s). Ihr and ihr are exactly the same except for capitalization. Then you just memorize unser and euer, and that they are almost the same suffices added on except for minor deviations.
And really, mein/dein/sein and ihr/Ihr have exactly the same suffices. So you're memorizing one set of declinsions plus the minor deviations euer and unser undergo in a couple of usages each.