For a good overview of what a codec is and some of the more common formats, Videomaker has a nice article.
If you’re interested in a deeper dive on how codecs work including information on bit depth, bit rate and color space, David Kong made a great video available here.