Most importantly, to be credit worthy, you need to live within -- under -- your means. You should have ample cash flow and the ability to save a significant share of your income. It's these qualities that mostly determine whether you can cope with sudden hardships like illness or job loss without affecting your creditors.
Unfortunately, being credit worthy is not enough to ensure good credit. High emphasis is placed on your Fico score. Fico is a very complex formula. And not to over-complicate, but it's not so much "a formula" as "a brand of formulas" that are all marketed by the same company. There are at least a dozen legitimate Fico scores, different versions that emphasize different things based on info from different bureaus. And then there is an entire cottage industry of companies who sell or give away credit scores that look like Fico scores but are in reality very different. These go by names like PLUS, TransRisk, etc. The ONLY place to 100% reliably buy a fico score online is MyFico.com.
That said, understanding roughly how a Fico is calculated helps you understand what you need to do to keep a high score. First, know the range. Anything under 600 is totally bad credit. Under 700 is fair credit and can often be worked with. 720 is the magic number for "good" credit. Anything in the high 700's or over is certainly considered excellent.
The most important pieces of the score are:
1. Utilization. Do you have credit accounts and do you use them. And importantly, do you NOT max them out. A maxed out credit card (or anywhere close to it) is very very bad.
2. Credit mix. For optimal results, have a few cards, a couple major cards (Visa, MC, Amex, Discover) and a store card (Target for example). Revolving loans like an auto loan are not nearly as important to your credit as revolving lines like CC's are. (That said, a poor payment history on a installment loan is every bit as bad as anything else)
3. Length of history. It's hard to have great credit until you have credit history at least a few years old. Open some cards, keep them open, use them every now and then. And while closing a credit card CAN have some consequences, this isn't one of them. When your length of credit history is calculated, it includes closed accounts until they fall off -- usually 10 years or so after they are closed. Along with this, the more new credit you obtain, the more your score will be hurt. When your credit report is pulled by a lender, a "hard inquiry" will show up that will last for 2 years. This is an early warning sign to creditors that you are looking to open new credit and may have new obligations that haven't yet reported because they aren't at least 1 month old yet.
4. Last but not least, on time payments. Going from zero to 1 late payment can drop your score SIGNIFICANTLY. On top of that, collection accounts from things like unpaid medical bills, cell phones, gym memberships, etc, can positively ruin your credit score.
I wrote a lot because this is a complex topic that other people have been kind enough to help me learn more about and master over the years. If you have questions, there are great experts here, and also over at http://www.CreditBoards.com
Good luck. Fico is complex but understanding it is a skill that is worth developing.
If you do have a job, that is always a good start. If you are self-employed, are you generating some income?
If you get at least two credit cards, periodically charge a few items to those cards. When you receive your statement, you can pay off the balance, or leave just a little in the balance, then pay it off in the next billing cycle.
Continue to do this for a period of time until you establish a record of payments. Making more than one payment on credit card during a billing statement "pings" that account and is considered a favorable action.