Does it cost me anything if I co-sign a loan for someone?
Only if (or to put it even more bluntly, when) they default.
If your friend / brother / daughter / whoever needs a cosigner on a loan, it means that people whose job it is to figure out whether or not that loan is a good idea have decided that it isn't. By co-signing, you're saying that you think you know better than the professionals.
If / when the borrower defaults, the lender won't pursue them for the loan if you can pay it. You're just as responsible for the loan payments as the original borrower, and given that you were a useful co-signer, probably much more likely to be able to come up with the money. The lender has no reason to go after the original borrower, and won't. If you can't pay, the lender comes after both of you.
To put it another way: Don't think of cosigning as helping them get a loan. Think of it as taking out a loan and re-loaning it to them.