Note my corrections above. Write the numbers one to twenty (inclusive) in full (words, not digits).
Using "the library" and "the books" work as long as the reader/listener knows which library and which books. Otherwise, you need "I went to a public library to borrow some books two days ago".
There are alternative word orders too:
Two days ago, I went to a/the public library to borrow some/the books.
I went to a/the public library two days ago to borrow some/the books.