The Japanese "You (あなた)"
When you start learning Japanese, you'll come across the word "anata," which means "you." Your textbook will have many example sentences using "anata." However, in real life, you won't hear it very often. In Japanese, "anata" is not used the same way as "you" is used in English.
But why is that?
The word "anata" doesn't originally mean "you" as a second-person pronoun. It has a long history. So how is it used in Japanese nowadays?
The word "anata" is used to refer to an unknown person. You'll often find it in essays or writings that use "you" when it doesn't specifically pertain to someone. For example, if you read a motivational book and come across a sentence like, "You, who try your best in everything, will eventually succeed in life," it would be 「何事にも頑張るあなたは、きっと人生で成功する」(Nanigoto nimo gambaru anata wa, kitto jinsei de seikou suru) in Japanese because it's not referring to a particular person. Similarly, during a graduation, if you listen to a motivational speech, the speaker might use "anata" to refer to all the graduates, not a specific person.
"Anata" is also used between married couples, but it's more commonly used by wives to refer to their husbands. It's similar to how couples in English use "darling" or "sweetheart" to call each other. So if someone visits your home and hears you say "anata," they would assume you're referring to your spouse because you wouldn't call anyone else "sweetheart" or "darling."
However, the use of "anata" between married couples is becoming less and less common. Nowadays, young couples almost never use it.
The third use of "anata" is when you're annoyed at someone and want to express your frustration towards them. This is the most common way "anata" is used today. That's also why some people consider the word "anata" rude. Not because it's inherently rude, but because it's uncommon nowadays, and when you do hear it, it's often used rudely. This is also why more and more people do not like to be referred to as "anata."
So what do you use instead of "anata"?
For someone you know but aren't close with, you use their family name followed by "san." If you feel familiar and closer to them, you can use "chan" or "kun" instead of "san." If you're really close, you can even use their first name with "chan" or "kun," or just their first name alone.
But what's the difference between "chan" and "kun"? "Kun" is used by girls to refer to boys or by boys to refer to younger boys. However, not all girls use it. It's also used for little boys and male pets. On the other hand, "chan" is used for little girls and female pets. But if you're close to someone, you can use "chan" to refer to girls or boys, or even adults.
But what if it's a stranger, and you don't know their name? Then you use their "role." For example, in business, you would refer to unknown customers as "okyakusan" or "okyakusama." Similarly, you would refer to store owners or cashiers as "ten'in-san." You can also use their job titles, like "omawarisan" for police, "oishasan" for doctors, "sensei" for teachers, or even their company names plus san.
But what do you call someone you know nothing about, like someone you meet on the street? You can refer to them as "sochira." For example, if you ask someone for directions and they say "take care" to you, you can respond with "sochira mo desu" to say "you too."
Or what if someone drops their wallet and you want to get their attention to return it? If saying "sumimasen" doesn't catch their attention, you can call them "oniisan" if they're a guy or "oneesan" if they're a girl. But you should only use it if you think they're younger than you, around the same age, or just slightly older. You wouldn't use it for someone much older, like the same age as your dad or grandfather.
To put it simply, I wouldn't appreciate anyone calling me "anata." I prefer people I know to call me by my last name or first name with "san" or "chan." If we're really close, then I don't mind being called by my first name alone. And if we're dating, it would feel nice if you called me by a nickname that is unique only to us.