A very common requirement which can be satisfied by various tools. Personally I like using Visual Studio 2017 Community Edition and I thought I would do a quick overview of it.
First thing, you can find the download from this link: https://www.visualstudio.com/downloads/ and once installed (making sure that you select SQL Server Data Tools) go find Visual Studio 2017 and you will be presented with your start screen.
Click through for the process. This tool is nice for one-off jobs, like when you want to synchronize production down to source control or see the differences between two environments. But if you’re doing these comparisons a lot, I think you’re better off scripting it out using SMO and Powershell.