The solenoid is activated by the electric signal from the backup light system on the vehicle. First things to check would be all of the pins on the hitch socket and trailer lead. Also possible fuse in the vehicle. Use a test lead to make sure that the signal is going from the socket on the truck. Be careful when doing this-don’t back over the person checking to see if that terminal in the truck socket is live!
If socket and lead to trailer is all good and receiving current then it could likely be the solenoid gone bad.
Before you go and replace anything, also check to see that the ground from the vehicle to trailer is sound.