Luckily du is a giveaway that it is pain not pomme that follows.
Even more luck provides the requirement for French to have a modifier in front of almost every noun.
The greatest luck of all is that the modifiers are all pretty easily recognized as to their sound and their meaning which provides many clues about the noun they modify.
Quite often the verb after the pronoun makes it clear. In this case, il a becomes ils ont. The two verbs are easily distinguished from each other.
In those cases where neither the verb or any modifiers indicate the number of the subject pronoun, and context doesn't help then, you can't differentiate between them. If it is important to signal number, then you have to rearrange your sentence.
Of course, it is usually only in learning situations like Duo where you have absolutely no context to assist you.
He's left already? Yes, really! They've left already? Yes, really! He's some bread? Yes, really. (except that it sounds unusual because the s at the end of he's runs into the s at the beginning of some)
It sounds perfectly normal if the speaker clearly distinguishes between each word in he's some bread. Most English speakers find it easier to sustain clarity by using has with the h pronounced instead.
de = of
du = de le = of the -masculine- = usually treated as some in English .....(du is the contracted form of de le)
de la = of the -feminine = usually treated as some in English. (the feminine form is not contracted)
Use de where you want to use of.
Use du/de la where you want to use some.
Il a du pain.
Il = he... a = has...... du = de le = of the......usually treated as some in English pain = bread
He has of the (some) bread.
In English, some is very often an optional word in a sentence. That means you can translate this sentence as he has bread or you can translate it as he has some bread. It means the same thing.
The problem is that dropping du from the sentence is not an option in French if du is the appropriate article to use in context. My advice is to get in the habit of including such articles in your translation into English because it doesn't hurt and will help reinforce your understanding of their use. If you get in the habit of dropping them in English when they are not required, you will find it that much harder to remember to include them in the French where they definitely are required.
a = has because: ...avoir = verb to have
I have = j'ai
you have = du as
he has = il a
we have = nous avons
you (pl) have = vous avez
they have = ils ont
Il a du pain = he has (some) bread.
Hope this helps.