Engine design is a very complex area.
Manufacturers are spending millions on engine design in order to meet ever stricter emissions, so don't even think it's just a case of getting the right amount of fuel in!

Modern diesels are far more complex than their petrol counterparts.
If you don't know what SCR, EGR, DPF, CR to name a handful are, and they're purpose, you really have a lot of research to do.

As for the basic mechanics, extensive FEA has to be done to ensure parts are as light as possible while still being able to withstand required loads. Lots of work has to be put into thermal design to avoid parts overheating or having problematic hot spots. And finally you have to make sure the parts are manufacturable without exotic processes.

I'm not trying to discourage you, I'm just letting you know of the lengths manufacturers are having to go to meet emissions. Each of those systems I've mentioned add substantial cost to every engine, and vehicle manufacturers are renowned for saving every penny they can, so they're not doing it because they want to, they're doing it because they have to.