I have a cast iron grate, but this method also works with grates made of other metals.
Dishwasher tablet: all-purpose detergent.
First, you need a pan that fits on the grill. Fill it with water and place it on the stove. Add two dishwasher tablets to the water. Bring the water to a boil; then, place a rack in the pan and let it boil for about half an hour.
After removing the rack from the hot water, begin cleaning it immediately; any available tool will