Conjunctions are words that link two or more words, clauses, phrases or sentences. In German, they belong to the group of non-declinable words. However, in German you will often find several posibilities to choose from to denote one single English conjunction. Such is the case with aber and sondern. For instance, consider the following sentences in English:
The child didn't want to go home, but to the park.
She is exhausted, but doesn't want to go to sleep.
They would be translated as follows:
Das Kind will nicht nach Hause gehen, sondern zum Park.
Sie ist erschöpft, aber will nicht schlafen gehen.
As you can see, both aber and sondern mean but in English. How do you know which "but" conjunction to use? It is actually quite simple:
Aber, which means but, however, nevertheless is used after either a positive or negatice clause.
On the other hand, sondern is only used after a negative clause when expressing a contradiction. In other words, the first clause of the sentence must contain either nicht or kein, and the second part of the sentence must contradict the first part of the sentence. Sondern can be translated as but, on the contrary, instead, but rather.