The first and most important thing is to ride according to the prevailing conditions. I might cruise along in upper-6th gear on the open road, but switch down to middle-5th (about 2/3rds the gear inches) or even lower for the shared-use paths in the middle of town. Urban streets are not the place to ride fast, even in the name of "conserving momentum". Some of the paths on the outskirts allow for higher speeds, due to good visibility and lack of other traffic.
It is the inner-urban context where you will encounter pedestrians most often, and they constitute hazards which you must give yourself time to negotiate. Halving your speed halves your stopping time and quarters your stopping distance. It also means you can sound your bell while being close enough to be heard.
A typical bicycle bell sounds in the frequency range that the human ear is most sensitive to, and can thus can be heard at a greater distance than an equivalent volume of shouting. It is the right tool for the job, usually. They're available in a variety of styles and colours, some more stylish than others. Mount it so you can operate it without moving your hands from the normal urban riding position.
At night, use lights front and rear, even if you're not on a road, and even if you're under effective street lighting. It will help people see you coming and plan what to do about it. Bicycles are uniquely invisible under street lighting, even though you can see perfectly fine. Virtually every bicycle sold in Europe these days comes with some sort of lighting set, and any that don't can have one fitted very cheaply and easily. Use it.
In my town, pedestrians are usually aware enough of cycle traffic to avoid blocking the whole path; they naturally walk to one side, and I can pass them without needing to give a warning. Give them some space so that you won't be dangerously surprised by a small deviation in their path, and also so that they don't feel threatened in the same way as you do when a huge lorry squeezes past at 50mph.
If there is not enough space to pass safely without a warning, then give a warning in good time and watch for a reaction. Some will simply move further to the side without bothering to look. Some will turn, see you, then decide what to do. Yet others will fail to notice, and you'll have to give them a second warning from a closer distance. Be ready for any of these, and be prepared to stop short of the obstruction until you can see that it has cleared.
Also be aware of other traffic, including other cyclists coming the other way. Stepping out of your path might put pedestrians in somebody else's way. Adapt to the dynamic situation.
Also be aware of destinations off the path that pedestrians might abruptly turn towards, such as crossings, shops, other paths, or benches. Try to pass on the side away from these attractions. Where a dedicated cycle path is provided adjacent to a road, a pedestrian crossing over the road must also cross over the cycle path, and cyclists are expected to be alert to this. Often a miniature traffic light is provided for cyclists to obey, synchronised with the one for road vehicles alongside.