It can be used in many situations, such as:
* Meeting someone for the first time: "Hi, I'm John."
* Greeting someone you know: "Hi, how are you?"
* Starting a conversation: "Hi, can I ask you a question?"
"Hi" is considered informal and is generally used in casual settings.
Let me know if you have any other questions!