Remove the magazine and and pull the slide back once and it will eject the round and rack the slide a few times and check to see that there are no more rounds in the gun.
You can tell if it's cocked by looking at the trigger - if it's forward it's cocked if it's back it's not.