A mallet will be too soft, you need a hammer, try tapping the pin with the nut loosened first - sometimes they give straight away - that way you'll save there thread. if it won't budge you have two options, replace the cotter and hit the old one straight and hard with the hammer or cover with a piece of hardwood and hit the wood with the hammer. These can be infuriating sometimes. A splurge of oil allowed to soak into the cotter hole also helps.