This article will teach you about the minimax algorithm and alpha-beta pruning, from a beginner's perspective.
Why is 6 afraid of 7? Because 7 8 9.