Take the hook from your inventory and it should go red over the winch (the long wire by the jeep). It should attach itself.
Click on the attached hook and your cursor should now be in the shape of the hook, go over to the front part of the jeep. There's a metal ring at the front. Take the hook and place it there and the hook should attach to the jeep.
Head over to the machine and press the red button and it should activate the machine to lift the jeep out of the ditch.