The very first thing that you have to do is to make sure that your house has ground fault protection at desirable locations. The second thing you have to make sure the device is working correctly.
How to test if the GFCI is working?
You can buy an electric circuit tester from any home reno store, or you can plug something into the outlet, such as a phone charger or hairdryer and then press the test button on the receptacle. If the device stops working, your receptacle is wired correctly and is in good working condition. Do not forget to reset the receptacle and make sure the power is back on. Some older outlets do not reset after testing, which means you need a new outlet.
Note: If the outlet trips very often, contact the certified electrician.