Possible anomalous couplings of the Higgs boson to vector bosons and fermions have been studied for the first time in CMS, focussing on the diphoton decay channel of the Higgs boson. The data were recorded by the CMS experiment at the LHC at a centre-of-mass energy of 13 TeV and corresponds to an integrated luminosity of 138 fb−1. These measurements utilise Higgs boson candidates mainly produced through gluon fusion, electroweak vector boson fusion (VBF), and in association with a vector boson (VH), which subsequently decay to a pair of photons. Events are categorized using matrix element techniques and multivariate discriminants. The CP properties in the Higgs boson couplings to gluons through a loop of heavy particles are studied, as well as the tensor structure of interactions with two electroweak bosons, analysing VBF and VH associated production. The results, interpreted as the fractional contributions of each anomalous Higgs boson coupling to the total cross section of a process, are found consistent with the standard model expectations. In this seminar, I will present the details of this important study and project the implications therein in Run 3 and beyond.