In Lima and other cities, your best bet for finding a restroom while on the go is to walk into a large hotel as if you're a guest and use the facilities there. The next best thing is talking your way into a restaurant bathroom; buying a drink is a nice gesture if you do. Unless you're in a large chain hotel, don't throw toilet paper into the toilet—use the basket provided, as unsanitary as this may seem. Flushing paper can clog the antiquated plumbing. Always carry your own supply of tissues, baby wipes, or toilet paper, just in case.
Public restrooms are usually designated as servicios higiénicos, with signs depicting the abbreviation "SS.HH."