Always use strong password and you may also use password manager if you like e.g. LastPass
Always enable the 2FA in your bitcoin wallet and use Google Authenticator to secure your wallet
Install anti-browser pop-up to prevent you from going to phishing site accidentanlly e.g. AdblockPlus
Feel free to contribute with more tips.
Everything you said is referring to Online Wallets. You shouldn't use them in the first place as they are the least secure type of wallet out there. Using desktop wallet or even bretter hardware wallet as its the best current standards are offering will give you the most protection.
I am also beginner but i am never lose my wallet so far because of hacking.
I am happy because i read a lot about this and not jump into phising threat.
I hope senior member here can educate ne comer how to prevent such hack to the wallet.