Weather helm, or the tendency of the yacht to head into the wind is caused by the center of effort (or pressure) of the sail(s) ("CE") being aft of the center of lateral resistance ("CLR") of the boat in the water (the immersed hull, keel, rudder). A rudder's ability to balance or overcome weather helm is dependent upon the flow of water over the rudder which is itself dependent upon the yacht's speed through the water, the angle of the rudder to the water flow; and, how clean/fair the rudder/hull surface may (or may not) be.
If the boat's bottom is foul, you will not be able to develop much speed which limits the rudder's ability to generate countering force. This loss of ability will be exacerbated if the rudder is also foul as water cannot flow smoothly over the rudder itself. In such circumstances, pulling the tiller further to weather will exacerbate the situation as the flow of the water over the rudder can "stall", in which case the rudder will generate no countering force to weather helm at all but instead, a lot of drag to further slow the boat, making things worse.
To solve the problem, your first task will be to ensure you've got a clean, relatively smooth bottom/rudder. With that done, ensure that you actually do have the sail trimmed properly for the point of sail by ensuring that your tell-tales (which I'm sure you have, yes?) are flying fairly from top to bottom of the sail ("when in doubt, let it out"). In heavier conditions that may require that you ease your traveler to leeward somewhat and harden the vang to take some of the curve out of your leech. And, when sailing do not get too heavy handed with the rudder. You want smooth steady rudder angle changes to prevent stalling flow of water over the blade. Depending upon the size, shape and position of the rudder, you do not want extreme angles. If you feel you are loosing control, you may have stalled the rudder, in which case you'll need to ease off the helm somewhat for a few seconds to allow the flow to reestablish.
If the foregoing does not work, the lead on your CLR vs. CE may be too great, in which case you will need to adjust your masthead forward somewhat and thereby move the CE forward. (One simply eases the back stay and takes up the slack on the forestay.) Approach this incrementally as small changes can have fairly sizable effects.
If none of the foregoing work, it may be that the main is simply too tired and nothing you can do short of recutting, or replacing, the sail will work.
FWIW...
PS: I suggest you pick up a copy of "Sailing for Dummies". You'll find it worth reading.