Most email services are smart enough, nowadays, to notify their users about potential hackers. For example, Gmail will notify you if a device it doesn’t recognise is used to log into your account. While it will not necessarily prevent damage, it might give you enough time to act. However, you do not have to rely on such emails only. Here is an article on how to detect keyloggers on your devices that will teach you what things to look for when it comes to cyber-attacks.