Try this first
That's a sensor problem
If the dryer finishes its cycle the normal way and the clothes are still damp, it isn't shutting down early. It thinks the load is dry. That usually comes down to the moisture sensor, the dryness setting or the size of the load.

