He checked out the books yesterday from the library.

(Is this correct? What is the opposite of 'checked out'? Can we use 'checked in' as the opposite?)

Yes, "checked in" is the opposite -- or simply "returned."

The sentence you wrote is fine.

Yes, the sentence "He checked out the books yesterday from the library" is correct. The phrase "checked out" refers to borrowing books from the library.

The opposite of "checked out" in the context of borrowing books is indeed "checked in." When you have finished using borrowed books, you return them to the library, and this process is called checking them in. So, if you were to say "He checked in the books yesterday at the library," it would mean that he returned the books.

To clarify further, the term "checked out" can also have different meanings depending on the context. In general, it means to take or borrow something temporarily. For example, if someone checks out of a hotel, it means they have finished their stay and are leaving. On the other hand, if someone checks into a hotel, it means they have arrived and are starting their stay.