No rule for this one
No ending or word group predicts the article of Apfel. Learn it as a pair and say it out loud: der Apfel.
der Apfel
It's der Apfel. Apfel is masculine, plural die Äpfel.
Der Apfel ist rot.
The apple is red.
No ending or word group predicts the article of Apfel. Learn it as a pair and say it out loud: der Apfel.