Indeed, it is not always possible to know, whether a noun is animate or inanimate.
The general rule is that nouns that denote animate objects (people or animals) are grammatically animated, i.e. the form of their Accusative case coincides with the form of their Genitive case. Inanimate objects (basically, the rest of the world) behave like grammatically inanimate: their Accusative case coincides with their Nominative case.
However, there are some exceptions.
First, whether a noun is animate or inanimate cannot be seen in case of nouns that do not change morphologically (like пальто or Пьеро). But their animatedness can be identified by the endings of adjectives that describe these nouns:
Я вижу грустного Пьеро, but
Я вижу старое пальто.
More problems arise in cases when semantic and grammatical animatedness do not coincide. I will try to list these cases here:
Names of aggregations: народ, толпа, стая. They denote animate objects, but behave like inanimate nouns. Истребить целый народ.
Names of anthropomorphous objects (e.g. toys): кукла, снеговик, матрёшка, марионетка, робот, солдатик. They denote inanimate objects, but behave like animate nouns. Слепить толстого снеговика.
Names of card and chess figures: валет, король, слон и т.п. They denote inanimate objects, but behave like animate nouns. Побить чужого валета.
Names of mechanisms and tools that sound like names of people: дворники. They have the same form as animate nouns, but be careful: when they denote inanimate objects, they change like inanimate nouns. Сломать дворник у машины.
Finally, there are cases when the noun can be both used as animated and as inanimate and denote the same thing (I only know three cases, but there might be more):
Запускать воздушный змей and Запускать воздушного змея
Изучать микробы, бактерии and Изучать микробов, бактерий
Готовить кальмары, креветки, моллюски and Готовить кальмаров, креветок, моллюсков (but always изучать кальмаров, кревечток, моллюсков).