If you pull the lever, the grain is automatically harvested and flushed to a collection point, where you only have to collect it. After that you have to replant the grain.
This classic Minecraft farm is probably known to most, but for the sake of completeness I'll post it here anyway.
When the lever is turned, water is released at the top, which can then flow down the stepped fields. At the bottom of the wheat farm, the grain is then collected and can be transported, for example, from a funnel into a chest.
Instructions:The field can be built infinitely large in principle, one must consider only that one must replant the grain after harvesting again, which one does not always have necessarily desire.
When building, you need to make sure that the steps in the fields have a length of 7 blocks, as water only flows 8 blocks and still needs to get to the next step. In addition, the fields must be irrigated so that the grain does not die. Therefore it is best to build a canal with water in the middle, but you have to cover it, e.g. with steps, so that you can walk on it. A water block irrigates all surrounding blocks in a radius of 4 blocks.
To release the water for harvesting on top there are many different possibilities. I usually use pistons, on each of which lie two blocks of sand or gravel. When the pistons are retracted, the sand falls down automatically. The advantage of this is that you can use normal pistons and gravel is usually available anyway. Otherwise you can also use sticky pistons, which lift blocks from above to block the sand. Or you put many throwers next to each other, which you have filled with a bucket of water.