A cosigner is a person assuming co-responsibility for your loan. He or she is liable to make payments to the bank or financial institution on your behalf, in case you fail to do so. In addition, his or her credit score can be damaged if you both fail to make payments on the loan.
With that being said, a cosigner almost always has to be someone you have a close relationship with.
Cosigners tend to be people you trust like family or friends; people who will take into account your situation, and be willing to take on a bit of risk so that you can be approved for a loan.
A cosigner with a strong financial background can help you secure a loan at a lower interest rate, qualify for a second personal loan, or become eligible for a higher loan amount. Their good credit score offsets your poor credit history (or lack thereof), and a lender takes into account both when they decide whether you are eligible or not as well as what loan options you qualify for.