what's the difference between (Der,dem,den,des) I mean all of them can be used before masculine nouns or everone of them must have situation or particular noun to come before it
In order to give nouns a "function" in a sentence (subject, object, etc) you have to decline them which means to put them into cases. That is done by changing the ending of the noun (as well as adjectives) AND the article.
Bsp:
1. Fall: Nominativ: der Mann
2. Fall: Genitiv: des Mannes
3. Fall: Dativ: dem Mann
4. Fall Akkusativ: den Mann
plural:
die Männer
der Männer
den Männern
die Männer
It is probably one of the hardest and most essential parts of the German language.
English however defines the function of a word mostly by the strict word order. In German you could put words in a random order and you would still be understood but it might sound stupid.
Understanding cases can be very hard and frustrating for people whose mother tongue doesn't use them. Hope it helped a bit. You can look it up on many pages.
Don't ask me for rules on how to know which ending you should use for which word. Because German people could not give you any, we just do it instinctively.
as a beginner, I would not put too much effort into learning the details of the cases; being aware of them is good, but this is more intermediate stuff imho
hahahahah last part if funny , and yes actually its really hard and as a beginner its difficult but I really thank you guys about that :)