Both,
Take your time and consider the following:
Spokes work in tension, not compression, so its the spokes at the top that absorb the impact, not the bottom,
To pull the rim to one side, ease the tension in the other direction first.
If the wheel is out of round, then work on opposite sides with both the left and right side spokes equally.
You can to this all with the bike on a stand and it can help to setup a pointer to give you a reference.
If you have a 'whack' in the rim from a rock then you can bash it back reasonably well with a large hammer and an anvil, but loosed the spokes a bit else they can end up broken. You'll have a scratch on the rim too, but at least the bump will be gone.
At the first tyre change on a new bike I like to remove every spoke and put antisieze on each thread and under the head of the nipple to make them easy to adjust for years to come.
They are easy enough to do, and you should with patience and small adjustmenst be able to get them to less than 1 mm runout, left/right and round.
Have fun
Steve