Would pointing as close to the mark as possible while keeping your knots up not be the optimal solution when going to weather?.
Yes, but not really possible. For sake of illustrations, consider the extremes: if you sail at 90-degrees to the wind, you're going to be going really fast... but you'll never get to the mark. if you sail at 0-degrees to the wind (straight upwind), you'll be pointed straight at the weather mark but not moving (0 boat-speed). Somewhere between those angles is an "optimal" angle, where you have the best blend of boatspeed and progress toward the mark. I guess what I'm saying is... it doesn't matter how fast you're going if you're going the wrong direction, and it doesn't matter if you're pointed the right direction if you're not making any progress. You want to find the sweet-spot, where you're combining a (less than perfect) angle with a (less than perfect speed) to get the blend of speed-plus-angle that gets you to the mark most efficiently.
I'm new at this so I'm not sure I understand VMG. Is it basically how fast you're progressing down a line "as the crow flies" towards your mark? As in, going quickly to an angle off the mark might be fast knots-wise but you aren't progressing very quickly up that "crow" line to the mark.
You get it. One way to think of it is to imagine that there is an arrow on your boat that is always pointing at the weather mark. It doesn't matter how fast you're going through the water in the direction the boat is pointing, what matters is how fast you're making progress in the direction that arrow is pointing. That's why we tack in headers, because being on the lifted tack is a good way to make progress more directly toward the mark.
High-end performance instruments (aggregating info from boatspeed, heading, apparent wind-angle, etc, and using those to calculate true wind-angle, etc) can calculate VMG, which is an indicator of how much progress you're making upwind. It is all vector math, which may hard to compute but is actually sort of easy to visualize.... it's simply the component of your "vector" (angle+speed) that is pointed directly toward the mark.
picture 4 boats sailing upwind at different wind-angles:
The blue boat is going really fast (black line is boat-speed), but the line that shows how much of that speed is in the direction of the mark ("VMG") is short
The yellow boat is going 30% slower through the water, but twice as fast in the direction of the mark.
The green boat is sailing slower still (through the water), but has a the best combination of speed-and-angle for getting to the mark
The orange boat is "pinching", sailing a closer course to the mark but going slower, so their VMG is not as good as the green boat.
(the pictures are to scale, but obviously the angles and speeds are made up - you'll have to figure those out for your boat.)
As mentioned above, you can kinda-sorta figure out your VMG using boat-speed and a GPS and some practice time on the water. Set a waypoint that is a couple of miles dead-upwind of you (as if there was a weather mark there). Sail an angle, get the boat trimmed to maximize speed-thru-the-water for that angle, then look at what the GPS says is your speed-toward-the-waypoint (often labeled "SMG" or "speed made good"). Make note of your boat-speed, SMG and wind-angle. Assuming there's no significant current, and that you're roughly downwind of your waypoint, that's a pretty good analog for your VMG on that angle in those conditions. Then repeat that exercise for other angles. After a bit of practice you can start to narrow down where the sweet-spot is, where you have a combination of angle + speed that gets you to the weather mark fastest.
BUT, I'd caution not to get hooked on numbers. What you want to do is find that angle and pay attention to how the boat feels there, so that you can reproduce it during a race. Racing is about *sailing*, not about being a math nerd (just Bruce's Opinion)
Bruce