Scenario:
I have a SharePoint list with two Content Type eg: Item and Announcement,
I need to display the view grouped by the Content-Type field as shown below:

I tried to modify the view.
But unfortunately, There is no field called Content Type in Group By section as shown below.
Solution:- Modify your view > In the group by section, > select any field like Title.
- Open SharePoint Designer > From the left menue > Select List & Library > Click on your List .

- In View Section, Click on your view to edit it.

- Search for a
.

- Scroll horizontally till get the
tag as shown below.

- In
tag, Change the Name of from Title to ContentType.

- Save.
- Open your view, It should be now grouped by Content type.