Many posts in this thread have given you good advices. I only want to underline that heeling to a large extent is a matter of decision, it is not a happening. Most boats, as has been mentioned earlier, sail best when not heeling. Some boats, those with long overhangs fore and and aft, sails better when heeling because they get a longer waterline when heeling.
Now the degree of heeling can be controlled by proper handling of the sails, like reefing and sometimes twisting the main sail leewards. So I agree with those that say that the main thing is to understand the physical laws governing sailing.
When heeling the keel area gradually becomes smaller and the boat will be more prone to drifting. When sailing flat the keel area is maximum. So even if the boat apparently goes faster through the water when heeling it will drift less and thus sail a shorter distance (against the wind) when sailing flat.
But still I believe the main thing is that you should gradually learn to control the boat, so that the amount of heeling in the end is your decision and not your fate.
Use your head, ram the wall till it falls.