Not knowing the specifics of your flush and valve system, I can only answer generally.
The fill-valve stops the inflow of water when some sort of sensor, typically an actual float, reaches a certain level of height either operating the fill valve to halt the ingress of water and usually ending the flush cycle, or it may in some way signal another part (unusual) to cease the water flow and end the flush cycle.
Most commonly a ‘flapper valve’ is physically lifted off of its ‘seat’ allowing the water in the tank to rush down into the bowl. Then the ‘float’ which operates the fill valve lowers until the valve opens, allowing water in to refill the tank. After the water exits the tank, the flush valve (or flapper) must lower onto its valve seat and re-seal the tank allowing it to re-fill ready for the next operation (or flush.)
If all of this only happens when you work the correct part manually (removing the cover and pressing with your finger) then one of two things are needed to restore correct operation (generally,)
You may be able to adjust some part of the mechanism to make it flush and re-fill as designed, stopping the fill operation at the correct level of water in the tank and not continue filling and possibly leaking water, usually into the tank. In many toilets the float may need replacement or adjustment. In many the fill valve components may need repair, adjustment or replacement. Often the flapper valve needs repair or adjustment - it may no longer be attached correctly, or the valve seat seal may be worn orobstructed.
In fill mechanisms with a single piece construction you may need to repair, adjust or sometimes replace that entire mechanism.
Either call a plumber or identify the type of mechanism, figure its mode of operation, and then try to determine where the fault occurs in its cycle. Without this info best we can do is guess!