No hack was involved. You logged into your device with someone else's account, so now it appears they are the owner of your device. That cannot be done remotely to hack your device, it can only be done by you where you would first have to enter your Apple Account password to remove your account from the phone.
You have a chance of removing their account from your phone, but you will need to provide proof of ownership of the phone, which usually means the original purchase receipt from Apple or Authorized Apple Seller. Follow the steps here to submit the documentation and note that your device will be wiped and it will not be possible to do if they put your device in Lost Mode.
https://al-support.apple.com/#/al/agreement