The gearbox is a very complex unit, and it must be repaired in a specialized workshop. Before repairing the transmission, it is necessary to determine the nature of the malfunction, which can be electrical, mechanical or hydraulic.
Do not remove the transmission from the vehicle for repair before the problem has been professionally identified as most tests require the transmission to be in the vehicle.