You are very sloppy in what you wrote. Sorry.
An Operating System is just a link between the machine code and the software.
No. Code is software. No idea what you mean.
A compiler translates programs written in a "higher level programming language" into machine code. This machine code is what is inside a .exe (aka an executable file).
The machine code (inside an executable) is directly executed by the processor in a computer.
And even that is not always true. Some CPUs have "microcode" that is even more elementary than the machine code. For the programmers it looks like the CPU is directly executing the operations in the machine code. But in reality, those operations are first translated by the microcode translator of the CPU into real instructions which are executed by the CPU. But this is details. All you need to know is: machine code is executed by the CPU.
What the OS does, is "load" and start each program. The OS starts a process, and the process runs the executable. The OS does not execute anything while a program is running. (See below about system-calls).
All operating systems have a kernel and typically have memory managers that handle large stacks of memory and how it is recycled.
Kinda true. The OS hands out large chunks of memory. It manages where that memory actually lives (in the page-file on disk, or in RAM).
The OS also provides a layer that translates the higher level languages back down to the hardware level so you can write more meaningful code without having to send commands in base 2 or hex.
No, the OS absolutely does not do that.
It's compilers that do that. And interpreters. And the assembler. Not the OS.
Another important thing that the OS does, is that it offers an abstraction of the hardware. Each piece of periferal hardware needs to be programmed in certain ways. Examples are hard disks (and ssds), monitor, keyboard, network interface, sensors, etc, etc. First of all you don't want every application programmer to reinvent the wheel, or redo huge amounts of works to deal with those periferals. Secondly from a security perspective, you don't want to give any process on a computer full control over all hardware.
Therefor the OS offers an abstraction of the hardware. It does this via "system calls". When a process wants to write something to disk, it uses a system-call to tell the OS that it needs to have bytes written to a file. Or is uses a system-call to set up a network connection. These system-calls look like library-calls to a programmers. The programmer includes those calls in his programs. The linker makes sure the correct machine code is included in the executable to make the system-call. When the executable is running, the CPU will see each system-call, and hand over control to the "kernel" to perform the requested action. The kernel will contain special code to deal with all devices, usually in the form of drivers. The kernel will do the work to do the requested action. And then the kernel will give control back to the user program.
Take a computer class somewhere. You'll have a better understanding of this stuff if you pick up a book and read.
Obviously even after you read a book, it's not easy.
An OS is not a compiler.
I do agree that chrstrbrts should read more about software architecture. The most important keyword to understand modern systems is "abstraction". And he clearly does not understand the concept.