It shouldn't affect your credit rating at all as long as you have complied with the terms and conditions of the credit afforded to you. Use credit wisely. It's so easy to feel you have all the money in the world. If you spend on a card keep paying any balance off to zero if at all possible. Whilst not the most expensive form of borrowing the Annual Percentage Rate (APR) of credit cards is eye wateringly high (usually about 29%) You lose the interest you pay and that is wasted 'dead' money. The more you borrow on overdrafts or credit cards the more you have to repay even before you have your own money to spend. It is all very depressing.
Do try where ever you can never to borrow money (unless on a managed mortgage instead of rent) Cut back on your day to day spending if at all possible. Those that are in charge of the Government want you to spend and spend and spend to keep the UK economy running. That is a false goal. Ask yourself if you really NEED to spend precious money on goods or services. If you can manage to save even a small amount each week you can soon rack up a lump sum for a buffer for spending on presents or essentials such as heating or electric.
if i open my first and only credit card, and then close it later, how badly would it affect my credit rating?
If you have a card, use it carefully, and make sure you pay off the balance in full and on time, then it's likely to have a positive effect on your credit rating as it shows you can use credit responsibly. If you close the account later, then over the next six years that pattern of behaviour will drop off your credit records.
Sometimes people get rejected for borrowing simply because there's no, or not enough, information on the credit record for a lender to judge whether an individual is a good credit risk or not.