You must install SQL Server first before installing Visual Studio 2017.
If you have already installed Visual Studio 2017, do not worry, just follow the steps below:
Uninstall the Microsoft Visual C++ 2017 Redistributable (x86) and (x64)
Then install SQL Server.
Do not forget to select "Database Engine Services"
Change "Startup Type" of SQL Server Browser from "Disabled" to "Automatic"
The installation will be done without any problems:
Then reinstall the Microsoft Visual C++ 2017 Redistributable (x86) and (x64)