The fact that when we pronounce "great" and "grate" we hear quite the same thing does not mean that they also mean the same thing. Yes, they have very similar spellings and yes, they are pronounced almost identically. But the definitions that each word stands for are completely different and have no relation one to the other.
Even so, confusing "great" and "grate" because of their similarity is a quite often error in English grammar. Let's quickly fix this by sorting out what each actually means, shall we?
Great vs. Grate
First and foremost, the main reason why you should never replace "great" with "grate" is that they are not the same parts of speech. "Grate" can be used both as a verb and as a noun, but "great" is neither of those. "Great" is an adjective, often used as a prefix as well. As you can see, the parts of speech these words represent never intersect - which makes it a major error to confuse them in any context.
When do we use "great"?
Basically, "great" is an adjective. It's used to describe something very good or very big, usually a synonym for "excellent", "important" or "large". In addition to this, "great" is also used, quite often, as a prefix before nouns such as "grandmother", "grandfather", "grandchild" etc., illustrating the relations between more than two generations. Here are some examples of how and when to use "great" correctly in every possible context:
Example 1: You've done a great job, I am so proud of you! - "great" is used as a synonym for "excellent", very good job.
Example 2: We have some great news, did you know that the museum was opened yesterday? - "great" is used as a synonym for "important", big news.
Example 3: Their grandparents welcomed them with great hugs and big smiles. - "great" can also be used as a synonym for "large", big hugs.
Example 4: There was a great crowd waiting for autographs outside the building. - "great" is used to refer to a large, huge number of people.
Example 5: There were so many emotions felt by the entire family, when the woman finally held her great-grandson into her arms. - as a prefix, "great-" is used here referring to the grandson of the woman's child.
When do we use "grate"?
Unlike "great", "grate" is not an adjective, but a verb and a noun. As a verb, "grate" defines the action of rubbing food such as carrots or cheese upon a special knife called grater, in order to break or cut it into very tiny pieces. As a noun, the word refers to a metal structure used to hold wood or coal in the fireplace.
Example 1: The recipe says I have to grate the carrots before using them into the carrot cake. - "grate" as a verb refers to the action of cutting something in very small pieces, using a special tool.
Example 2: The grate used at the fireplace had an elegant, exquisite design and looked very resistant. - as a noun, the word refers to the metal structure holding coal and wood in a fireplace.
You should never use "great" instead of "grate", mainly because they are different parts of speech and can never be replaced, and secondly because they define completely different things and will confuse your audience if used wrongly. After all, it's not even that hard to keep in mind that "great" is an adjective also used as a prefix, whether "grate" is an action, a verb, commonly used in the kitchen, as well as a noun with a unique definition.