when i mention the name of a book, and the text i quoted from as well, in a text, should i write the name of the book in italics and insert the text i quoted between two inverted commas? or what is the correct way of such writing?

Yes, you are right. Quotes go in quotation marks. Titles (of books, poems, plays - and also ships) are italicized, for example:

The famous line "To be, or not to be, that is the question..." comes from the play Hamlet.

If you are using handwriting (or perhaps a typewriter that does not have italics), underlining is another traditional way of expressing titles, for example:

The famous line "To be, or not to be, that is the question..." comes from the play Hamlet.

Another way to express a title if you do not have italics or underlining is with quotation marks, for example:

The famous line "To be, or not to be, that is the question..." comes from the play "Hamlet".

Whether to use double or single quotation marks is a question of style. I personally recommend double quotation marks as a rule (because there is less confusion with apostrophes, for example in "it's" or "she's"). See more about double quotation marks and single quotation marks.