Many hosting companies offer a free domain name when you buy a shared hosting plan. All you have to do is sign up.
Whether or not using a free domain name from your hosting company is a good idea is an entirely different question.