The basis is MiniMax, a literal implementation would involve 2 methods that take turns (mutually recursive), 1 for each side.
Lazy programmers turn this into NegaMax,
one method with a strategically placed - operator. - SO / wikipedia
Negamax search is a variant form of minimax search that relies on the zero-sum property of a two-player game.
This algorithm relies on the fact that max ( a , b ) = − min ( − a , − b ) {\displaystyle \max(a,b)=-\min(-a,-b)} {\displaystyle \max(a,b)=-\min(-a,-b)} to simplify the implementation of the minimax algorithm.
Alpha/Beta pruning is keeping track of a Window of best moves (over multiple depths) to detect dead branches.