Codons are an (effectively arbitrary) grouping of 3 consecutive nucleic acid bases that ribosomes can translate into a amino acid when building a protein. Technically any combination of 3 consecutive bases could be considered a codon, however biologists usually only group base pairs based on how they are normally read by a ribosome. Note that this means it is possible for a single sequence of nucleic acids to code for multiple proteins, with the only difference being the starting offset.
Proteins are made of amino acids not nucleic acids. Nucleic acids are polymers whose elements contain a phosphorus group. Amino acids contain an nitrogen group (an amino group to be specific).
They are distinct biopolymers. DNA and RNA are polymers of just 5 different types of nucleotides. Proteins are polymers of some 20 radically different aminoacids.
Codon is just a triplet of nucleotides. But proteins are made out of amino acids, they have “nothing” to do with DNA in itself. It just happens that DNA transcoded by a codon table to proteins encode some useful ones that in certain environments can bootstrap the whole process and do some useful work.