I don't believe it should matter whether it's mac or pc (at least I hope not cause otherwise my instructions will not be very helpful), but just open the minecraft launcher, and towards the top, above the picture, there's a few bars. "News", "Skins", and the like. You'll need the last one "Launch Settings". Click that, and then on "Add new". Select 1.12.2 and you're good to go.
Edit: Actually, after that you might have to go back to the launch tab with the green button and click on the down arrow next to the green button and select the 1.12.2 version as it may not automatically switch to 1.12.2.