When you install any new distro, most of the time it does not come with the video and audio codecs to play videos online and offline.

The best way in my opinion to use codecs without spending hours installing is:

Install needed apps as flatpak.

The most common apps that need codecs is browsers and video players like vlc and mpv.

Just install them(Make sure you enable flathub repo) as flatpak (installed by default in most distros) and you will not need to spend time installing codecs from untrusted third party repos ever again.