Website source code for WordleSolver.com, which solves the daily Wordle word puzzles.
Check out how it was made in a series of tweets.
If you're just looking for the meat and potatoes of how the optimal best guesses get chosen check out solver.js.
For a more academic approach to solving this sort of problem, check out Donald Knuth's paper The Computer As Mastermind which is about a similar algorithm for solving a similar game.
WordleSolver.com doesn't use the optimal solving strategy. For more on those, check out Wordle-solving state of the art which use wordle decision trees like this.