A program is a set of instructions that tells the computer how to do something. The basics of any program are showing how the computer will receive input and return output.
A program solves problems. But programs are very literal. It's like making a contract with a genie. The genie (the program) will give you exactly what you ask for. Exactly. Errors occur when the programmer makes assumptions about what should happen instead of precisely describing what input can be received and what output will result.