First you will need to find and purchase a ghost character. You will get these through collecting everything anyway.
Professor Binns
Lily Evans
James Potter
Bloody Baron
The Fat Friar
The Grey Lady
Nearly Headless Nick
Moaning Myrtle
The easiest ghost to get is Fat Friar he's in Hufflepuff common room (once you have a hufflepuff character) cast wingardium leviosa on the portrait at the left end of the common room, then on the cake it throws out twice.
Once purchased simply press x to scare 20 people and the achievement is yours.