You ask probably about declination. Thr stupid way to learn by heart is tedious and only useful when German is used in a professional manner. The most used way is just to talk and ask for correction. As time passes, one gets a feeling for the sound of this language and the habit of usage (provided the environment is able to talk rather correctly). Just learning rules is in my opinion not very successful, because there are too much exemptions from rules. But a general answer is difficult, it depends on the situation of the student of this language.
xDustyxSeptember 2023ah.. Sprachgefühl ist wieder die Antwort. Danke sehr!
There is of course more than Sprachgefühl, for a first glance on the instructions part of german grammar machinery one could recommend this site https://learngerman.dw.com/de/adjektivdeklination/gr-39121328
In general the german grammar isn't a part for it's own but, like their english sister derived from the ancient latin grammar rules.