Ultimately, the responsibility for the loan is your daughter's. Rather than stepping in and taking over the loan, I would encourage you to let her pay -- with your help -- and learn a little responsibility in the process. For example, you could ask your daughter to come to you for the money every month, and she could be responsible for sending the payment.
It's tough to adequately help the friend who co-signed your daughter's loan. The friend's credit already has been damaged due to the loan default. And the only way to remove the friend's name from the loan is to refinance it into a separate and new loan.
If you want to refinance, I encourage you and your daughter to communicate with the lender and understand what it will take to bring the loan current. Federal loans can be rehabilitated one time. Once it's rehabilitated, you can explore deferment and other repayment options that would make it easier for your daughter to repay the loan on her own.
If it's a private loan, you will need to review the loan document and check with the lender about how to proceed. Depending on how long the loan has been in default, you may have the option to settle the loan for less than the full balance. However, settling would mean you would have to come up with a big chunk of cash upfront. Also, I'd rather your daughter take on at least some of the responsibility for repayment. An additional negative to this approach is that your daughter's co-signer will have a settlement on his or her credit report, too.
The friend has learned a difficult lesson about the dangers of co-signing a loan. This reinforces my long-standing advice that the only time to co-sign a loan is never! The good news is that the damage to the friend's credit is not permanent and the defaulted loan will not be included in the friend's credit report after seven years. Lastly, the friend's credit will begin to improve before the seven-year reporting period is up.
A final thought to consider is that paying the defaulted loan with a new loan or settlement will not magically improve your daughter's or her friend's credit. It'll improve only if she pays all future bills on time.