How do Japanese names work

In the japanese naming system, people typically only have two names. The 'middle name' common in english-speaking countries doesn't show up in japanese. The two names are a 'given name' and a 'family name', which occupy roles similar to the 'first name' and 'last name' in english (and the family name is passed down from the father's side). However, when you say the name in japanese, you say the family name (what we would call the 'last name' in english) first, and the given name second. Further confusing matters is the fact that, when speaking to or about someone in any but the most informal of situations, you often use their family name, the way we might say something like 'Mr Smith' where 'Smith' is the family name.

In the case of Mei Misaki from Another (the example you gave), Mei is her given name, and Misaki is her family name. If you look a character up on Wikipedia, it will often give their name in english followed by their name in both japanese symbols and romaji, for instance:

Mei Misaki (見崎鳴 Misaki Mei)

When it is shown like this, the romaji version (shown together with the japanese symbols) is always in the japanese naming order, i.e. the first word is the family name and the second word is the given name. As in any other language, there are certain words and word forms that show up frequently in names, and if you read enough japanese names, you get an idea of patterns to look for that can help you unravel the naming order even when it isn't made explicit. For instance, girls' given names often end in 'ko'.

The 'san', 'kun', etc are honorifics, similar to things like 'Mr' and 'Miss' and 'Dr' and 'Madame' and so on in english. However, there are a lot of them and their usage can be very nuanced. You can see a guide on most of the common ones here:

The issue is complicated further if you are trying to understand the usage of honorifics when watching anime, because the characters may use an honorific or pronoun inappropriate to the situation in order to be condescending or humorous, or a character may simply use inappropriate honorific or pronouns simply as a personality quirk. Subs and dubs may or may not make any attempt to translate the effect of this.