If I'm reading a book, either paper or ebook, I take notes on paper. I have a hardcover A5 spiral bound notebook for all those notes taken as I read, as well as notes on movies as I watch or any other in-the-moment notes. If there's some text that I want to excerpt, then if it's a paper book I make a little note with the page number so I can go back later, and for ebooks I take a screenshot of the page. Screenshots are automatically synced to my PC, so I can extract the text at my leisure. I also maintain a reading journal in which I reflect on what I'm reading, at a little further distance--after finishing a chapter or completing a book, or after I've had a few days to consider things.
For long-term storage, I have built from scratch a custom database/wiki which is personalized for my workflow. I put into that entries for everything I read to which I attach the (cleaned up) notes or excerpts. It also handles my todo list, diary, and any other kind of data I need to capture. If there's something I need that it doesn't do, I code it up, so I have a single resource with all the information I want to store.
This works very well for me, but that's only because I've sunk a few hundred hours over the past few years into it. I learned a lot about web development doing it (and parlayed that experience into professional web dev work), but it was only really worth it because making detailed notes on materials I read or watch so that I can summarize and analyze them is a major part of my learning process, and I use it daily. I expect to spend thousands of hours using it, in the coming years, so it works out, but if you don't have such extreme needs as I do, then I don't suggest reinventing the wheel.
People have suggested a lot of web-based solutions. I prefer to do things locally when it's practical, myself, so let me suggest a few alternatives. Before I resolved to write my own solution, I made use of a number of tools:
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.