First, don't panic. The quickest way to tip a canoe is to start leaning this way and that, trying to compensate for the current, waves, wake, wind, etc. Stay centered and keep your torso vertical AT ALL TIMES!
Second, become comfortable in the canoe in calm, unmoving, shallow water first. Don't go after rivers or waves until you're comfortable in the canoe and moving it feels like second nature.
Third, learn how to sit in the canoe. On a flat lake, sitting in the seat is fine but when the waves pick up, the current takes you along, some jackass in a speed boat sends a monster wake your way, you need to adjust your seating immediately. Kneel in the canoe, knees apart for stability, with your butt leaning back against the edge of the seat. This lowers your center of gravity and allows you to adjust for the roll of the boat. Remember, DO NOT LEAN. Your torso needs to always be perfectly vertical.
Fourthly, if large waves are coming, hit them head-on. Drive straight into them and cut through them or hit them at an angle. Do not let them hit you broadside.
Finally, if it gets really hairy, stop everything and lean forward until the rocking stops. If your center of gravity is low and you do not lean, you will not flip unless someone actually rams your canoe.
Here's an example of keeping a vertical torso even when the canoe is leaning.