When writing in a higher language such as e.g. C, you can use code obfuscators to make your C code extremely hard to read.
If you want to make decompiling even impossible, you could modify the machine code generated by the C compiler. Even slight moderations are already enough.
If you want to make it (virtually) impossible to even disassemble the machine code, you could encrypt your binary itself except for a small bootstrap that will unencrypt the remainder of the binary when it runs.