I assume this is a rule of locative, or maybe just an exceptional declension, that ogród becomes ogrodzie?
If the stem ends in a hard consonant (p, b, f, w, t, d, ...), the ending becomes "-'e", but a lot of weird things can happen before the ending and I think those things have to be learned by heart. For example:
"ogród" - the stem ends in d so the ending becomes -'e. The apostrophe means that softening should occur: d becomes dzi and now we have "ogródzie". Additionally "ó" becomes "o" and now we have "ogrodzie".
The problem with declension is that a lot of nouns fail to obey the rules so it's better to memorize it.