A black eye, or a shiner, is an injury to the face rather than to the eyes. The name comes from the fact that the bruising occurs around the eye (or eyes) due to trauma to the area. Most black eyes are minor injuries and will go away on their own after about a week or so. In some cases, however, if the trauma is particularly severe, there might be more serious problems such as a fracture in the skull.
When you get a black eye, swelling is definitely going to be part of the problem. One of the first things that you should do is to try to get the swelling down. The tried and tested method of applying an ice pack almost always does the trick for a black eye. Get an ice pack and apply it on the affected area for 10 minutes. You can repeat this several times in the next few hours as necessary, making sure that there is a period of rest in between applications. Fifteen minutes of rest should be ample. If you do not have an ice pack, you can make your own by getting some ice cubes and placing them in a resealable bag. You can also use frozen peas, or any other vegetable for that matter. Of course, we cannot ignore the use of frozen steak, which has a lot of anecdotal evidence supporting it. To make it more comfortable for you, wrap your cold compress in a soft towel before applying it on your eye.