When do à and de merge?
English has no such thing as to the, of the: you simply write two words. In French, à (to, at, in) and de (of, from) cannot stand before the articles le and les. They must merge with them into one word.
What are they used for?
au, aux: place, goal, person
à says where someone is, where they are going and who they are talking to (to the, at the, in the).
Je vais au cinéma.
I am going to the cinema.
Il va aux toilettes.
He is going to the toilet.
Je parle aux enfants.
I am talking to the children.
du, des: origin and possession
de says where someone comes from (from the) and who something belongs to (of the, or 's).
Je viens du marché.
I am coming from the market.
C'est la voiture du voisin.
It is the neighbour's car.
C'est le livre des enfants.
It is the children's book.
Before la and l', à and de stay separate
Je vais à la gare.
I am going to the station.
Elle est à l'école.
She is at school.
Je viens de la ville.
I come from the city.