The algorithm is trivial, the proof is the work
Every greedy algorithm has the same shape: sort by some key, walk the list, take whatever is still feasible. That part is three lines. It is never the difficult part, and it is never where the mistakes are.
The difficulty is entirely in two questions. Which key? and why does taking the best-looking option now never cost you later? Get the first wrong and the code still runs, returning answers that are plausible and sometimes even optimal on the cases you tried. Skip the second and you do not have an algorithm, you have a heuristic that you have not measured.
So greedy is best understood as a proof technique with a small amount of code attached. This lesson is about the proofs: two general-purpose argument shapes, and one theorem that settles the question exactly.

