There are two indefinite articles in Swedish, en and ett. There is rarely an easy way to determine which article should be used with any one word, so the gender of each noun should be learned separately.
en skola, en pojke, ett spöke, ett slott
The indefinite form of a word is usually used when something is mentioned for the first time.
The definite article is normally attached to the end of the word as an inflectional ending. In singular forms these endings are -n, -en, -t and -et and in plural -na and -en. In cases where the noun is preceded by an adjective, the definite article is also added as a separate entity in front of the word (in singular: den and det, in plural: de).
skolan, pojken, spöket, slottet den tyska tjejen, det lilla rummet, de långa gatorna
The definite form of a word is usually used when something has already been mentioned before or is a fact that is universally known.
Johan träffar en tysk tjej. Tjejen är på väg till Sverige. Johan meets a girl from Germany. The girl is on her way to Sweden.