Using foil to clean your cooking grates is not recommend.
There’s an outdated, and potentially dangerous, practice that promoted cleaning cooking grates by laying aluminum foil on the grates, turning the grill to high, and letting it run for a while.
Doing so is a safety concern.
Laying the foil on the grates can alter the proper ventilation of heat from the grill, which can lead to damage of the internal components, and create a dangerous situation.