To have a website, you need both a domain and hosting. Your domain gives people a way to find your website, and your hosting is space on a server (a remote computer) where all of your website content resides.
Think of a domain like it's your website's street address, and hosting is like the website's house. You can have your address before you build your house, but ultimately you will need somewhere to put your things.