Prague Castle provides free toilets: at Prašný Most (on the way from the tram stop Prague Castle), at the cathedral (on its right corner), in the yard opposite the Lobkowitz Palace, in the royal garden (tram stop Letohrádek Královny Anny).
Old Town Square: paid toilet in the park behind the Townhall, free toilet in the gallery & cafe Dům u kamenného zvonu (At the Bell),
Wenceslas Square: free toilet in the department store Primark.
more at: https://www.wckompas.cz
advice: You can use a bathroom in any restaurant. If you offer them 20 CZK coin (or 1 Euro) and ask politely, they will smile, let you in and usually they will NOT take the money.