Extracting Psilocybin from mushrooms is definitely possible, but usually not worth the hassle. It's easier to just dry the mushrooms out, powder them and store them in gelatin capsules.
From what I've read, Psilocybin is soluble in warm/hot Ethanol and insoluble in cold Ethanol. So if you were to try and do an extract, you would need to powder the material and allow it to soak in warm/hot Ethanol for a reasonable amount of time. After that step, I'm fairly certain that placing the Ethanol liquid in the freezer would then cause the extracted Psilocybin to precipitate out into crystal form.
The method above won't yield 100% pure Psilocybin, I think that Ethanol would pull some contaminants aswell.
The only other thing worth mentioning, and it should be obvious, always be careful when heating flammable solvents. Never use any solvent near an open flame. A hot water bath should work well enough, I've never extracted Psilocybin myself though, so I can't say for sure.
"Life moves pretty fast. If you don't stop and look around once in awhile, you could miss it."