There's software available which can help, with this being the most popular:
https://www.mailwasher.net/
However once you've started to get spam it can be difficult to get rid of. You really need to act
before that point by ensuring that you never use an email address where a computer can guess at the bit before the @ symbol.
For example, spammers know that if they send out emails to
[email protected],
[email protected],
[email protected], etc, etc (and then do the same for email addresses with different endings) at least some of them will get through to real people. So you should use email addresses such as
[email protected] to avoid software being able to guess at them.
Further, you should ensure that you've got several email addresses, so that you can use different addresses for different purposes. (Indeed, you might need to consider using a different address for every website you sign up to). The email address you use for internet shopping, for example, shouldn't be your 'prime' address (which you should reveal only to friends and/or colleagues).
If you're using lots of different addresses, and one of them starts getting spam, you can simply abandon your use of that address without interfering with your email activities via your other addresses.
Lastly, you should never click on 'unsubscribe' on a spam email, as that will simply tell the spammers that their mail has got through to you, ensuring that you'll then get thousands more spam emails.