Getting people to use the cycling infrastructure (and not the pedestrian areas) is exactly an enforcement issue.
To note, the sidewalk I mentioned above while writing the earlier comment parallels a local cycling route. It's a 25 MPH residential street that also has wide paved shoulders, with sharrows, signed as a formal bicycle route. I ride it almost daily, and it's a great route to ride. There's no reason to ride a bicycle on the barely-two-person-wide sidewalk there except out of ignorance.
Plenty of cities have built cycling infrastructure. That's the solution, not law enforcement.