It doesn't sound like hackers cracked your iPhone. (That would imply that criminals with computer programming skills got past your iPhone's security mechanisms by exploiting some technical means.)
It sounds like criminals attacked you in a much more low-tech way, by sending you "phishing" e-mail that tricked you (not the phone) into revealing your Apple ID and your Apple ID password.
Once they had that, they used that to lock you out of your Apple ID account, and to lock your phone as though it was lost or stolen. That required no hacking at all – just the malicious use of the Apple ID and Apple ID password that you unwittingly provided.
You need to regain control of your Apple ID, and set a new password that the criminals cannot guess.
If you think your Apple Account has been compromised - Apple Support
My iPhone and Apple ID were hacked, what can I do? – Apple Community
If you are the original purchaser of the iPhone, and have proof-of-purchase documentation that clearly shows your name and the iPhone's serial number, you could ask Apple for help with removing any Activation Lock the criminals placed on your phone. (Absent convincing proof that you are the owner, Apple will not help.)
How to remove Activation Lock - Apple Support