...but in the past I have done gym workouts only to get a massive headache the next day from strained neck muscles, pushing myself too much maybe...
Pain, mostly because of sore muscles, is nothing bad if it occurs shortly, i.e. 1-2 days after a session in the gym and if it goes away within approx. 2-3 days and absolutely normal if you're untrained or after a break from weight-training, if you've already built up some core musculature - and often more prominent in the region(s) you've already issues with. Train your whole body, use compound exercises and additionally ones that isolate specific musculature -
additionally! A sign of injury and something to look out for is, if pain occurs during a session, which in most cases is a warning sign/red flag (!) that you do something wrong or that what you're doing is not good for you. Keep in mind that there are many exercises but not all of them are good. I remember the first months, especially the first weeks when i began, which were honestly (and obviously) not that nice, but after that i felt much better! I personally would avoid exercises where you push or pull something from behind the head, not only because all of 'em are of no real advantage when compared to others but also because they carry a great risk for Injury - especially for ppl like you! And you're right: it's not good to push yourself too much, which can make things worse, especially when done on a constant basis!
Start slowly and work your way up in small increments, and don't run into the trap of comparing yourself with others, using more 'n more weight just to pretend to be strong and though when you are not. This is what many ppl do in the gym and is the reason why so many fail to continue and don't progress in building muscle and strength. If you start weight-training, read some good books (Stuart McRobert's Books are essential and i also recommend those of Mike Mentzer, a legend in Bodybuilding) and simply gather as much information as possible about good exercises - and the ones that work
for you! This can only be accomplished via trial and error, so try carefully and enjoy it, because there's so much (hidden
) pleasure to find in doing something good for your body! Always be honest with you and keep in mind, that it's better to do something slowly with joy and progress than nothing at all - because the latter is what you'll regret some day!