In a properly managed environment, the security team usually tracks the server logs for any failed login events. Here’s an example of such report:

Looking at Windows’ log [image missing, whatever…]

Checking SQL server for the target user

Granting permissions

Granting connect permissions

This has been just a punch of screenshots for no reasons. In fact, the resolution for this error is completely different from the the assumptions above. Search this blog further if you’re looking for a fix for your identical error code.