If you didn't do anything except remove the slide, you should be able to just cock the hammer with your finger, then hold it back/down while you put the slide back on. If you messed up and either did not capture the recoil spring or let it go, you have a real problem, and come back for more help.
Jim