If your device has been compromised by a malware any information you enter could potentially be stolen, so disable your internet connection, ensure you have backups for sensitive files on your device and then wipe it clean (especially if you're unsure the extent of the breach).
There's very little you can do it someone already accessed your private keys as they can easily move out funds in it, you can attempt to be faster and send all your funds out to a new wallet if you suspect the previous one is compromised. In the off chance that this works, you should also consider mixing or coinjoining your coins after they have been moved to a safe location to maintain your anonymity.
If you truly are compromised, then you have to assume that its a pretty sophisticated piece of software that you have been compromised, although the reality is that most malicious software is minor, and recycled among "script kiddies". However, the only real safe way of uncompromising yourself would be to nuke everything you have, and don't use it again. Obviously, most of us aren't going to go to that extreme, but nuking the hard drive, or simply replacing it might be the better option. Sometimes its worth booting into qubes os, and plugging in the hard drive, and trying to recover some of the files using a compartmentalized system to prevent it leaking elsewhere. This is usually extreme too, but when it involves private keys, or any sensitive data then its worth taking the precautions.
Most malicious software doesn't touch anything other than the operating system, so most of the time replacing the hard drive, so there's nothing left on it is the best option. Of course, you could write 0's to it, and probably be fairly confident its fine, but its up to the individual if they want to take that risk.
However, disconnecting the internet after finding out your already compromised means its probably already too late, and has spread via the network if it has that capability (which most don't). That's why I'm always an advocate to using compartmentalization software to protect from spreading anything to other areas.