1. I read Chapter 2 of my history book.

2. I read chapter 2 of my history book.
=======================
Which one is grammatical? Do we have to use the capital letter or not?

You'd have to look in the table of contents of the book or at the first page of the chapter.

If it's printed "Chapter 2" in the table of contents or on the first page of that chapter, then you use capital C.

If chapter 2 has an actual title, then that title would get the capital letters in the right places and you'd refer to it as chapter 2 or the second chapter.

Both sentences are grammatically correct, but they differ in terms of capitalization. The first sentence, "I read Chapter 2 of my history book," uses capitalization for "Chapter" as it is a specific title or heading. The second sentence, "I read chapter 2 of my history book," does not capitalize "chapter" because it is seen as a general reference to a chapter in the book.

Whether to use capitalization or not depends on the style guide or preference you are following. Some writing styles, such as MLA (Modern Language Association) or APA (American Psychological Association), recommend capitalizing specific titles or headings like "Chapter." On the other hand, in more casual writing or when not referring to a specific title, capitalization may not be necessary.