If you know your track (GPS) and you know the winds aloft....you can deduce your heading.
The principle is correct, but unfortunately one rarely knows the winds aloft to any accuracy, because the forecasts are pretty poor (at common GA altitudes).
The way one normally flies is that one flies a
heading, and one adjusts the heading so that one's
actual track (displayed on the GPS) lines up with the magenta line (the
desired track) on the GPS.
Then, from the difference between the track and the heading, plus any difference between TAS and GS, one can see what the wind aloft is. Usually this is very very obvious, at a glance.