In the US, one can use Libby [1] (and likely other tools) to read books online. I guess it's the same elsewhere in the world. I don't think it will be the end of the world if public libraries put more and more of their books online, and use their physical spaces for other civic functions.
[1] https://libbyapp.com/