If you need to cash a check that was originally made out to someone else and has been endorsed over to you, do so at your own bank. Many banks refuse to cash checks for non-customers, and even banks that do could refuse to cash a check that is not made out directly to you.
In order to cash a check made out to someone else, that person must first endorse that check over to you. For instance, your friend should sign the back of the check by writing "Pay to" and your name. After that endorsement is in place, you can take the check to your bank and cash it.
You need to provide valid identification in order to cash a check that someone else has signed over to you. The name on the identification should match the endorsement on the check. For instance, if your friend endorsed the check over to John A. Smith, the identification document you provide should clearly show that name. You need to provide a photo ID like a driver's license or passport.
If the check you are cashing is for more than the current balance in your account, the bank may restrict the amount of money you can receive until the check clears. For instance, if you have a $1,000 check and $200 in your bank account, the bank might be able to give you only the $200 until it has verified that the check is good. After the check clears, you can get the remaining $800.