Recognize the problem
Leeches are almost always found in water, usually near the surface. To eat, they stick to the body of an animal (including people), make a small cut in the skin with their mouth and then drink the blood. They can be very common in swamps used for growing rice. When there are very many leeches in rice paddies, they can be a pest for the farmers.
When farmers walk in the flooded rice paddies, the leeches can smell the skin of the farmers, even under the water. The leeches swim towards the feet and legs of the farmer and grab onto the farmer’s bare skin. Leeches have special teeth for cutting the skin of people and other animals, but they cannot cut through some materials such as cloth, rubber and plastic.
Probably the best way to avoid having leeches attach to your legs while working in the rice paddies is to wear protective garments over your feet and legs. It is possible to buy very simple plastic "boots" that can be worn to prevent leeches from attaching to your skin. These boots are made of a light plastic (like plastic bags), so that they are not too expensive and also easy to carry. They come high up on your legs, higher than normal boots, and can be tied at the top.
If these plastic boots are not available or practical, then you can try to make your feet and legs less attractive to the leech. This can be done by rubbing palm kernel oil over your legs, feet and hands. This oil will only work for a short time so reapply it after two hours.
For farmers with developed rice swamps, it could also be helpful to regularly drain the water out of the swamp for a while. Draining the swamp will not kill all the leeches because they can survive without water for a while, but it could reduce their numbers.