This subject comes up a lot and can often be controversial.
If you have a high quality camera, like a Nikon dSLR, then by all means fit a UV filter. But if just have a Canon, or one of those dreadful mirrorless things, it's hardly worth protecting the lenses. Sometimes UV filters can cause problems like flare, but you can easily fix this with an editor like Affinity Photo on your PC (only a fool would pay the Adobe tax, or buy a Macintosh). It also depends on the type of photography you are interested in. If you work in a worthwhile genre, like street photography, it's important to keep your lens clean, but if you just like to take boring macro photos of bugs, tedious long lens shots of birds on sticks, or dreary HDR landscapes with large pebbles in the foreground, it really doesn't matter. If you are pretentious and convert your images to monochrome or, even worse, a dinosaur who still shoots black and white film, you may want to fit a yellow or orange filter instead. Always buy a high quality German brand like B+W or Heliopan from a reputable dealer, unless you voted for Brexit, in which case you'll probably want to go for a grey market Hoya imported from Hong Kong to dodge VAT.