Take the mainspring out and see if it will cock. The gun might be coilbound (unlikely though). Then take out the piston and push the end of the rod into the trigger block to see if the trigger will engage and hold then. If it does then the chances are that your trigger is okay but it is worth taking it apart to clean and lube and see if the trigger spring could do with renewing. I usually deburr the sides of the sear and trigger as well. Put the gun back together without the spring and see if it cocks ok now. If it does not, then push the piston back with a rod/screwdriver to see if it engages. If it does then it is likely to be (1) the slot in the piston has worn and will need welding up (2) the cocking arm has bent and will need straightening a touch.