UI and UX complement each other, but they don't have to be the same. UI is a product's visual and functional design(the user interface), while UX is the overall experience of using it(the user experience).
UI and UX go hand in hand. If you're designing a website or an app, you need both. It's essential that your UI makes sense and works properly, so users feel comfortable navigating your product, and it's equally vital that you think about how it looks and feels as part of your UX.
For example, if you want people to navigate your site easily, you might use easy colours on their eyes or make sure each page has a consistent look so users can quickly identify each page from another. You also might want to make sure there are no confusing elements on your pages. For example, if there's a button on one page that says "Buy It Now", but another controller says "Add To Cart", having those two buttons side-by-side could confuse users trying to buy something online.
If you wish to know more about UX and UI, you can refer to Intellipaat’s UI UX Design Course which contains all the information related to UI/UX design.