Read everything first, then follow the steps listed at the bottom.
If you've been hacked, then viruses may have been uploaded to your Hard Drive, and obviously your IP is known to at least someone. Therefore, you need to clean up your Hard Drive, and reset your IP.
Cleaning up your Hard Drive entails either running Antivirus on it, or formatting it. But your Antivirus can only remove viruses that are lower level than your Antivirus level, so I wouldn't trust it. I would recommend doing a Hard Drive format instead.
Note: Formatting your Hard Drive will return your file system to the state it was when you started playing the game. Reducing it to the 3 starting software, all at the lowest level. In other words, NO FILES OR VIRUSES WILL SURVIVE A HARD DRIVE FORMAT, so back up any files you want to keep if you have space for them in your Network Attached Storage.
At the top right of the game, you can see your IP. It may for instance look like 220.127.116.11
In general the format of an IP is 4 numbers ranging from 0 to 255, separated by 3 dots.
By right clicking on your IP at the top right, you will see two options appear in a dropdown menu, the first of which would start a task to reset your IP.
If you have already reset your IP recently, the time for the IP reset task to finish may be quite long. You can speed up the reset by paying *in-game money*.
Paying to speed up the IP reset will generate a withdraw log in your Local Logs. If you're being hacked, then your hacker will be able to see this log, and use it to hack into your bank account. To be specific, it will withdraw from the bank account marked as "Primary" in your Finances window.
Therefore, if you do have to pay for the IP reset, I would advise you to consider your current in-game bank account to be garbage. But it is possible to do the payment without losing all your money. You can either purchase BTC or stocks in-game as a store of money that noone can affect (1*). Doing BTC or stock transactions also doesn't leave any logs.
To deal with your compromised bank account, you can simply visit a bank and run a command to create a new bank account. I would advise against visiting Wells Fargo though, so if your Wells Fargo account is compromised, I would recommend just kissing it goodbye.
Note: IP resets increase in cost by $500 each time you pay to speed them up. The cost to reset is also lowered though by prestiging. The max cost is $250,000.
Okay. The steps to becoming unhacked:
(0) If you already have an IP reset ready that you didn't pay to speed up whilst you were hacked, then skip to Step 5
(1) Cobble together enough in-game money to be able to speed up the reset of your IP. You can quickly do some missions or ask someone in chat to subsidize you. You can message @Jarl_Ballin in chat if I'm online. If nothing else works, you can just wait.
(2) Start the IP reset task by right clicking your IP at the top right and clicking "Reset IP"
(3) For whatever bank account you're going to use for the IP reset purchase, store excess money in BTC or stocks, and leave just enough money for 1 or 2 IP resets.
(4) Speed up the IP reset, delete the withdraw log that is generated from this action, but it's not too big a deal if your hacker gets the info from it faster than you can delete it. DON'T ACTIVATE THIS IP RESET YET.
(5) Do the following two steps in quick succession.
(5.1) Type in the command "format harddrive" in your terminal
(5.2) Activate the IP Reset in your Task Manager (by clicking the green button)
(6) Type in the command "ls" into your terminal. If you see a file which has an ID other than 1, 11, or 31, then you should quickly format your harddrive and reset your IP a 2nd time. The reason for this check is that someone could hypothetically upload a virus after your harddrive format but before your IP reset.
(7) If you didn't have to pay for an IP reset whilst you were hacked, you're done. Though maybe you want to do the following steps just in case. It could be the case that you purchased an IP reset before you realized you were hacked.
(8) If your primary bank account was a Wells Fargo account, treat it as garbage (2*). If it's not a Wells Fargo account, you can visit that bank and run the command "account new" to get rid of the old bank account and create a new one (this will also remove any funds in that account). It may not be wise to do this right now though, as the person who hacked you could also squat at that bank to catch your IP again, so you can visit a different bank instead and just create a new account there.
(9) Set your primary bank account to an uncompromised bank account. Convert your BTC or stocks back into money. Or don't, they are safe ways to store money, though the value of BTC and stocks fluctuate.
(1*) Okay, this is not 100% true for stocks, but if your net worth is not at least in the billions then this will almost certainly not apply to you.
(2*) I do not advise visiting Wells Fargo unless you have the a Network Bypass file, or you have a friend at Wells Fargo who can delete your authentication log during the minigame you need to do to access it. Without either of these things, you are risking the possibility that someone squatting at Wells Fargo will have at least several seconds to see your IP in the authentication log before you can delete it, which will get you hacked again.