The operating principle of class D is pretty simple. Just make a PWM signal proportional to your input signals amplitude, make that PWM signal super powerful, then low pass filter it to get a high power output signal.
The general way to get a PWM signal proportional to your input is to compare your input signal to a triangle wave.
The general way to make the PWM signal super powerful is to use a full bridge of mosfets.
The general way to low pass filter that powerful PWM signal is with an LC filter in the middle of the full bridge.
If you understand all these words, you understand all you need to know to make a class D amplifier from scratch. Some of the waveforms I was describing are shown in the image linked here:
https://www.researchgate.net/figure/Class-D-Amplifier-Waveforms_fig2_303685974All the extra 'complicated' circuitry in the schematics you see online are just different ways of doing these three steps. There is also a lot you can do in the way of feedback and other neat tricks. No doubt a lot of the circuitry also has to do with something called gate drive for the mosfets.
I had a good time as a beginner designing and building one of these from discrete components and some simple IC's like 555 timers. Learned a lot. Hopefully you will have a similar experience.