Explain the rule again without making the child feel foolish for needing to hear it.
GRATITUDE
GRATITUDE
Forgetting a rule happens for the same reasons in children and adults: it was abstract, the moment was busy, the reason behind it was never made clear. Repeating it with a sigh adds shame to the information, and shame is the part that gets remembered, which makes the next question less likely to be asked at all. What you want is a child who checks when unsure. Irritation is understandable, and it is also expensive.
Say the rule again in plain words with the reason attached, as though it were the first time. If you are too annoyed for that, say you will explain in a minute.
What tone do you use the third time a child asks?
Free, with nothing to buy inside it.