Open Visual Studio Installer from the Windows Start menu, or by selecting Tools > Get Tools and Features from the menu bar in Visual Studio.
Visual Studio Installer opens.
Select the Individual components tab, and then scroll down to the Code tools category.
Select Class Designer and then select Modify.
The Class Designer component starts installing.
For more details, visit this link: How to: Add class diagrams to projects