If your credit history is atrocious and you spend money long before you get it, having someone co-sign your home loan is not going to solve your problems -- unless that person plans to move in with you.
Co-signers, or co-borrowers, can help bring you up to the income needed to qualify for a loan, but guidelines can be very specific depending on the type of loan. Usually the key word is "occupancy."
According to mortgage professionals, a co-borrower will not make bad credit good. People are often mistaken that the co-borrower's credit will solve the credit problems for the person planning on living in the home.