An algorithm is in essence a set of instructions to accomplish some particular task. How detail the instruction goes depends on the writer. To give a really solid example are the cooking instructions in any cookbook you know where it is
- turn oven on
- place ingredients 1 and 2 in bowl
- mix ingredients 1 and 2
-place ingredient 3 on cupboard
- knead ingredient 3
and so forth until the finished product.
It is the same idea for writing a program. The idea is too write a set of instructions that explain how the program is going to be built. For example,
if we try to build a program that saves a user input.
The algorithm might go:
print a message telling user input whatever data
set up variable so data can be stored
place input data into variable
repeat data back to user.
Also there are some decent youtube explanations of how to employ algorithm as I realize this may not be the best explanation. However, using the cooking instructions as an example is usually the best way to think about it. So in essence an algorithm is just a way to organize our thoughts on how and what we want to accomplish with our program.