There are two methods. For the sake of explanation we will assume that ashwini mudra is performed in a meditational asana.
Method 1: rapid contraction
Sit in a comfortable sitting pose. Relax the whole body. Close the eyes. Breathe normally. Rapidly contract and relax the anus. Try to confine the contraction to the area of the anus though you will find that other pelvic muscles will come into action. Let the muscular contraction and relaxation be rhythmical. Don’t strain. Repeat the practice for as long as you have time available. In this method there is no synchronization between breath and contraction.
Method 2: slow contraction and retention
Sit in a comfortable pose. Contract the anus as you inhale. At the end of inhalation hold the breath and also the contraction. Let the contraction be as tight as possible but without strain. Release the muscular contraction as you breathe out. This is 1 round. Repeat as many rounds as possible. This method requires synchronization between the breath and the movement of the anus.
It is impossible to confine the muscular contraction only to the small area of the anus. Other pelvic muscles and muscles associated with the sexual organs will also contract. But try as much as possible to concentrate on the contraction at the anus. At first this is difficult, but with practice it becomes easier and easier.
In method 1 the awareness should be on the muscular contraction and relaxation at the anus.
In method 2 one should be aware of the coordination between the breathing and the muscular contraction and relaxation.