Libraries are your best friend! If you're young, you probably pass as a student OR prospective student. And many Libraries are 24 hours (though I don't know during COVID). If you're near a university, you can ask for a guest pass to their library. You can be charismatic and say that you're considering studying there (most libraries are chill about this anyway).
If its like 2 am, just lay out some books on your table and pass out in your chair on the 5th floor. There's a low chance a security guard will come and wake you up.
If you're in an area with restaurants / bars, you can keep watch from a distance of people dining outside. This is so easy to pull off at cafes because the service is usually very slow and if people leave a bit of a pastry and coffee when they leave, you can absolutely just sit down casually and finish it. Most people mind their own business and if you act natural, nothing will go wrong.