My feelings on pirating books are complicated. On one hand, if you genuinely can't afford or can't access a book any other way, I'm not going to just say not to. Especially for things like school textbooks which, let's be honest, are horrifically overpriced anyway.
On the other hand, few fiction authors can actually make a living selling their work. Many struggle to break even. Many quit because of that.