Financially, your credit score is the single most important variable that you have control over. It can get you a much lower interest rate on your mortgage than the next guy, or it can prevent you from getting approved at all. Over the life of a mortgage, a few percentage points means tens of thousands of dollars in saved interest.
Credit cards will help your credit score, contrary to popular belief. Banks want to feel safe giving you a credit line, so if you have other credit cards that you are paying on time, that's enough proof for them. The longer you've had a credit card history, the more they trust you.
So sign up for a credit card or two. One caveat: each time you apply for credit, it shows up on your credit report as an inquiry. If you have several inquiries, that means you are looking for credit and your score may temporarily drop a few points. So don't apply for several credit cards right before applying for a mortgage. However in the long run, your credit score will increase from you having credit cards.
Check your credit score for free via this link.