Whether you use et, en or ei depends on the gender of the noun. Neuter nouns use et, masculine nouns use en and feminine nouns use ei. Generally speaking feminine nouns can be either masculine or feminine, as odd as that might sound, so for the most part you only have to worry about a noun being neuter or masculine. However, occasionally you will find nouns that are only masculine or only feminine.
Perhaps the best website to use to find out the gender of a noun is ordbok.uib.no. You can find the gender of a noun by searching up the noun and looking at the letter next to the word; for example, if you search up måltid you'll see a letter n next to the noun that you can click on. This means the noun is neuter, and clicking on the letter will bring up a table with the plural form, the definite form and the plural definite form. It's a very useful website.