Adjective endings are where B1 students plateau, because the usual presentation is three tables of sixteen cells and no explanation of when to use which. The system is simpler than the tables make it look, and it rests on one question: has the article already shown the gender and case?
After der/die/das (a definite article), the article has done the work. The adjective only has to be -e or -en. Nominative singular takes -e (der gute Mann, die gute Frau, das gute Kind); almost everything else takes -en. That is the whole table for most practical purposes.
After ein/kein/mein (an indefinite or possessive), there are gaps. "ein" does not show whether it is masculine or neuter, so the ADJECTIVE has to: ein guter Mann, ein gutes Kind, eine gute Frau. Where the article is already clear, the adjective goes back to -en: einen guten Mann.
With no article at all, the adjective takes the ending the definite article would have had: guter Wein, gute Milch, gutes Bier, mit gutem Wein. This is the table you need for menus, recipes and abstract statements — and it is the one most learners have never looked at.
The practical route: learn the first table properly (-e or -en after der/die/das), then learn the five places where the indefinite differs. Five exceptions is a manageable amount of memory; three full tables is not.
A habit that helps more than memorisation: when you write, say the article and the adjective together as one sound — "einguter", "mitdem guten" — because that is how they are actually stored by fluent speakers.