When you have bought the game, you can download the stand-alone launcher for Minecraft here. It will automatically update the game files with the latest version. You'll be able to play the game without an Internet connection if you've been online at least once.
Minecraft for Windows
Download MinecraftInstaller.exe. If given the option, save the file instead of running it. Save the file anywhere you'd like, then double-click the program to run.
Minecraft for Windows (alternative)
If you have issues with the new Windows download, you can try a alternative one by downloading MinecraftInstaler.msi. If given the option, save the file instead of running it. Save the file anywhere you'd like, then double-click the program to run.
Minecraft for Mac OS X
Minecraft for Linux / Other
Download Launcher.jar (86 KB). The jar is executable and should work as-is, Also this does require Java to be installed, use 7Zip to extract it.
If you want to run the server on any other OS or without GUI it's a bit more involved (see this wiki article for a tutorial). First make sure you can use java from the command line. On Linux and Mac OS X this should already be set up but on Windows you might have to tinker with the PATH environment variable. Download and run server.jar with java -Xmx1024M -Xms1024M -jar minecraft_server.1.17.1.jar nogui.
Some older systems will not be able run the latest Minecraft launcher, because of this the old launcher is still available for download below.
Please note: With the old launcher you will not be able to play any version past 1.5.2.