I have had some stock in a company for a number of years that pretty much went bankrupt, so I will have a loss when it is sold (around $500). I have decided that I definitely want to sell the stock, but for tax purposes, should I sell this stock on a year that I have some gains registered to take advantage of the small tax benefit? Is this correct, or is there anything else I should know?
If you have someplace to put the money which you think will yield significantly better returns, by all means sell and buy that.
On the other hand, if you think this stock is likely to recover its value, you might want to hold it, or even buy more as a "contrarian" investment. Buy low, sell high, as much as possible. And diversify.
You need to make a judgement call about the odds. We can point out the implications, but in the end whether to sell, buy, hold or hedge is your decision.
(This also suggests you need to sit down and draw up a strategy. Agonizing over every decision is not productive. If you have a plan, you make this sort of decision before you ever put money into the stock in the first place.)