Definitely check the switch on the pedal first..
The cruise-control is controlled by the PCM (there is no separate c-c module), so that function itself will not fail unless the PCM fails altogether.
The great probability is the switches involved and/or the wiring to the switches.
The cruise function gets it's feedback from the same VSS sensor that drives your speedometer, so if the speedo works then that points to the switches:
The brake-pedal switch, the C-C activate switch on the turn-signal stalk, and the ACCEL-DECCEL switches on the stalk. That's all.
Could be the cruise switches on the stalk, but as all these guys suggest, start with the brake-pedal switch.
That is the most common failure and it's by far easier to check visually and easier to test electrically.
As the C-C is working intermittently, check the physical adjustment of the pedal switch first.
It may be that the switch is sitting there adjusted too "tightly", so that it is randomly actuated by vibration and tiny movement of the brake-pedal as you drive.
You could try taking a drive then engaging the C-C. Touch the pedal as lightly as possible..
Just barely touch the pedal.. If that kills the C-C then there’s your problem
Re-adjust the position of the switch so the switch is not activated until the pedal has been depressed an inch or so.
Keep in mind that even a very brief actuation of that pedal switch will disengage the C-C.
That sort of physical mis-adjustment would cause an identical problem with the C-C on any vehicle.