Are you aware of any changes to your setup that might've triggered this - eg, a new iPhone etc? If you turn all those other devices off, then restart your computer and modem, does the issue persist?
What does it do instead of "working"? Recap the process you run through to get it to try to check for messages, and make note of how what you're expecting to happen differs from what does happen. For example, do you see any strange symbols next to your account names, and do any error messages pop up on your screen?
How many email accounts do you have configured in Mac Mail, how many are affected, and which email providers are they with?
Are there any issues in sending emails from this computer?