One way of knowing you’ve been hacked is if you suddenly get locked out of your account and can’t use your credentials to log back in. Another could be changes made to your account - you might notice that your username, bio, password, etc. have been changed.
Other than that, the hacker might contact you via Email or Whatsapp asking you for money in exchange for your account. Keep in mind that hackers don’t really care for your account, what they truly want is your money.
How can you avoid this? Keep an eye out for social engineering attacks. If you get a text or an email from a source that seems fishy, don’t trust it right away. Be suspicious of unsolicited calls, emails, or texts asking you for information. Don’t directly follow these links and pay attention to the URL of the site.
If you’re still suspicious, contact the actual company directly to check if the message that was sent to you is legit. Keep in mind that organizations like Instagram will never DM you, and you can always check all of the emails you've received from Instagram under the "security page" in your settings. For more information on how to protect yourself, → you can read this article on our blog.