1) Wear gloves when handling food that is liable to get under your nails.
2) Make sure to have an easily accessible hand-washing station and use it often. Include a nail brush at it (if you don’t have one a toothbrush will serve) and use it.
3) Do not scratch yourself as skin flakes will contribute to the gunk that builds up under our nails.
4) After washing you hands apply a thin coating of vaseline or hand lotion. That will help keep stuff from building up under your nails as well as counter the drying effects of washing your hands so often.
5) Keep your nails trimmed short so there is less space in which dirt can be trapped.