You are looking for the red marker in a box of 12 mixed markers. Nothing about the box helps, so you take them out one at a time: blue, green, black, red. Found on the 4th try. If the red one had been last you would have needed all 12, and if there were no red one you could only be sure after checking all 12. That is linear search: best case 1 check, worst case n checks, and on average about half.
As code it is a single loop over the indexes: for i from 0 to len(list) − 1, if list[i] equals the target, return i. Only when the loop finishes without returning do you know the target is missing, so the 'not found' result goes after the loop, never inside it. Searching [56, 12, 37, 5, 23] for 5 checks 56, 12 and 37, then finds 5 at index 3 on the 4th check. Searching it for 40 checks all 5 items and then returns −1.
Linear search is not always the slow choice. Binary search needs sorted data, and sorting first costs far more than one linear search. But on a large sorted list that is searched again and again, linear search wastes effort: a sorted list of 1,000 needs up to 1,000 linear checks but at most 10 binary ones. And when you need all the matches, say every 7 in a list, linear search must not stop at the first one; it keeps going to the end.
Think of it like this. Linear search is reading down a printed sign-up sheet to find a name: start at the top, read each name, stop when you see it. You never skip ahead, because the sheet gives no clue where the name might be. Reaching the bottom without seeing it is the only way to be sure the name is not there.
Core idea. Simple but slow for large lists — must check up to every element in the worst case.