Unfortunately, There's nothing you can do because bitcoin transactions are irreversible so once confirmed no changes can be made.
There are tons of possibilities on why your wallet has been compromised but only you can determine that as we don't know what you did. It is often said that online wallets are the most unsafe kinds of wallet but if you must use it, only small amounts should be stored on it and usually having a strong password and enabling 2fa should be fine unless your backup seed is not properly stored or you have some keyloggers.
To prevent this from occuring again, You should start from choosing your wallet and educating yourself about it because you'll be the one who will keep your funds safe most of the time. There are a lot of articles when you do a quick search on google but in short it says "everything should be clean" such as how you store your seed/keys, where you access your wallet etc.
Heres a tl;dr of wallet types:
--Snip--
Safest:- hardware wallet: both reasonably cheap and easy to use
- airgapped pc: expensive and a little bit harder to use (you always have to transfer unsigned/signed transactions between an online and offline machine)
- Paper wallet: very cheap and very secure if generated in the correct way, but hard to use (you have to sweep and discard the paper wallet each time you use it, then transfer the remaining value to a new paper wallet)
Medium:- Desktop wallet: free, but you need a clean PC and you NEED to encrypt your wallet (using a strong passphrase). Virusscanners/firewall are a must have
Unsafe-ish:- Android/Ios wallets: I call these ones unsafe because it's harder to verify the wallet's signatures, many people know less about their phone's OS than they know about their desktop's OS, and phones can easily get stolen/lost
Unsafe:- Any wallet where you're not the (only) one in controll of your private keys. This includes exchanges and online wallets