Yahoo! Mail server might be down that would cause the connection issue.
Here is the list of the few common reasons that would lead to Yahoo! Mail not working on Mac: There can be many reasons that would prevent you from accessing your account.
When mail errors occur, it is mostly due to the invalid settings that had been accidentally configured.