After reading your question and the suggested solutions. Many believe it is an electrical problem, but your Trooper didn't come as a diesel and you said the engine was running and you said it wouldn't go into any gear. You heard something turning until you turned it off.
If you have a manual transmission:
If the clutch wouldn't allow you to shift into any gear but neutral then there are teeth broken in the transmission that won't allow the synchros to line the gears with the spinning input shaft from the clutch disc.
Or it could be that the clutch itself is damaged.
If you can put it into any gear and still nothing, look under the vehicle and look to see if the entire drive shaft is turning. If it is, put it into neutral, place the transfer case into 4 wheel drive and place the transmission into 1st gear. If it begins to move forward, STOP!!! Your rear axle pinion or ring gear is severely damaged. If it doesn't move, then the transfer case is also broken.
If the drive shaft is not spinning, again, put it into 4 wheel drive again and see if it moves. If it doesn't, it is the transfer case, if it does, check to see if any of the U-Joints are broken.
For an automatic transmission:
If you can't take it out of park it's the transmission.
If you can put it into reverse, Drive, or any lower gear it could be the torque converter or the transmission. If you hear a clunk when it is in gear but nothing happens, put your foot on the brake and have someone else look under the vehicle to see if the drive shaft is spinning. Yes means the rear ring and pinion is destroyed. If it isn't, then place the vehicle into neutral and push the 4WD/4WD Auto button and place it back into drive. If it moves forward check for broken u-joints, if it doesn't, then it's the transfer case.
If any of the above have diagnosed the problem and you are unfamiliar with repairing drivetrains, then have it towed on a flatbed tow truck to a company that specializes in transmissions and drivetrains. Get a quote to repair it. If repairing it is worth more than the actual value of the vehicle itself then you now have a parts vehicle.
Always check your options to repair the damage, sometimes replacing the entire component (transmission, transfer case, or axle) then you can replace it with a used one that works from the junk yard and replace it. Sometimes you can get a parts car for less than buying a junk yard component, make sure that the part car doesn't have the same problem. If it is more economical to repair, then you just got lucky.
If you need further help, reach me via phone at https://www.6ya.com/expert/scott_843b43f7ebebd3f5