Indeed, when I needed to build up a credit history, I got a credit card to help with that - but do remember to ensure they are paid off every month via Direct Debit.
Paying for retail goods via a credit card also comes with extra consumer protections.
Just don't fall into the trap of treating the credit card as credit you don't have, but instead to debit money you can afford to spend.
2c.