A nice way to tell the sex of a corn snake is by the shape of the tail. Reptiles have what's referred to as a hemipenis, and because of the way it's positioned in their tail, the male's tail will be thicker after the cloacal opening when compared with a female, who's tail will taper immediately after the cloacal.
(Source)
Another, potentially more reliable method, is by counting the scales after the cloacal. Simply count the rows from the cloacal to the tip of the tail.
- 130 or less is a good sign that you have a female.
- 140 or more is a good sign that you have a male.
- If you count somewhere in between 130 and 140 then it's not going to be definitive to say. In this case I would suggest also looking at the shape of the tail for that thicker section.
Note: Unless you have an extremely well behaved snake, it's going to be hard to count the scales on it. So I would suggest taking a picture, or even using one if it's shed skin.
Of course these are all going to be reliable to a fault, and aside from putting two snakes together and waiting to see if they mate, the only way to know for sure is by probing or popping the cloacal opening to see the sex organs.
As I've mentioned in one of my other answers I'm against these practices because I believe it's an unnecessary risk considering the damages that can be caused by it. While it's debatable about whether or not snakes are less at risk to the damage than lizards, I would insist that anyone wanting to perform the procedure themselves have hands-on training from someone with experience (and that you can trust) first. Only someone with training should probe a snake.
My suggestion is to try the non-invasive methods first, then if you're not convinced after that, you can take it to a reptile vet to have it sexed. As a new pet, it's a good idea to have a check-up from a vet anyways, so you can have it checked for parasites at the same time.