As mentioned before, it is beneficial to get your hens used to being handled.
There are a few different techniques but I tend to pick them up by going to stroke them. This often causes the hen to flatten to the ground which is a natural instinct as if in anticipation for a cockerel to come along and mate. At this point calmly close your hands over the birds body making sure you include the shoulder like part of the wing up by the neck to prevent them from flapping. It's important to have a relatively firm hold of the hen so that she feels secure but not too tight that you restrict her breathing or risk causing injury. Once you have hold of them you can position the hen practically under your arm. To prevent them from squirming around, particularly when trying to administer treatment you can slide one hand underneath the hens body and clasp the legs with your fingers.
You should avoid chasing your hen and grabbing at them as this will cause distress and you may harm the bird if pulling at the feathers.
Hens seem to have an uncanny sense that you're wanting to pick them up especially for treatment and the ones that usually like a cuddle will make it as difficult as possible to catch them!
The Right Way to Keep Chickens
by Virginia Shirt
Diatom - Effective treatment and prevention for Red Mite
When selecting eggs to hard boil, choose eggs which are over 3 days old to avoid the egg white clinging too much to the membrane (which can make peeling more tricky).