Let us take an example. What do you do when you need to find the area of a rectangle? You follow a simple process, take the length and breadth, and then multiply them. But what if you want someone else to do it for you? Simple, we give them instructions on how to do it.
What if that someone is a computer? How do you give instructions to a computer? The answer is a code.
A code is a set of instructions we give to a computer to make it do something we want it to.