If a written work is old, the copyright may have expired, in which case the work is in the public domain and there are several places you might be able to download a 100% legit copy for free.
Note that recent English translations are copyrighted even if the original foreign-language work is old. The English translation is only in the public domain if the English translation itself is old.
Project Gutenberg
Project Gutenberg, which is older than the internet, has a growing collection of over 60,000 free fiction and non-fiction ebooks.
Standard Ebooks
Standard Ebooks offers over 680 public domain fiction and non-fiction ebooks that have been professionally proofread and designed.
Amazon
Last I checked, there were 280 AmazonClassics titles, and they’re adding more all the time! Most of them are included free if you sign up for Kindle Unlimited. They typically sell for less than US$5, and typically at least some of them are available free.