You can play D&D for free (see this page for details), but if you want to go to the next level, consider these resources...
Essentials Kit (the very minimum)
Amazon US
Amazon AU
Amazon UK
Amazon JP
Starter Set (a little more)
Player's Handbook (for the enthusiast)
Dungeon Master's Guide (for DMs)
Monster Manual (book of monsters)
Xanathar's Guide to Everything (expanded options and rules)
Tasha's Cauldron of Everything (more expanded options and rules)