Yes, the cold compress will be beneficial to your sore eyes. When you get the strong knock on the eyes, you'd better use the cold cloth from the refrigerator or the cold ice to cover on the eyes to release the symptom which will at the same time decrease your pain at the eyes.
Your sore eyes may be caused by an infection, dry eyes, and foreign object. If you got it, your eyes may be red and swollen and your vision may also be impaired. In order to avoid the risk of permanent vision loss, you need to take some measures, such as cold compress. Place a tea bag in the freezer until cold. And gently put it to your sore eye for 15 minutes. Repeat it 4 times a day. The cold tea bag will ease the soreness.
Well, it seems that your eyes are not in good conditions. So, generally speaking, warm compress could help the circulation of your blood, and relieve stress and eye strain, so I suggest warm compress. Anyway, if you have got sore eyes, you should not only rely on warm compress, you also need to take care of your eyes from other facets. Just take more breaks at intervals and try to take more exercise.