Here is a link to a searchable by location guide I found very helpful from Bone Fish Gamer
http://www.bonefishgamer.com/2011/06/lego-harry-potter-years...Rescuing all the trapped students can be one of the trickiest trophies in the game, with 1 hidden in each main story level and 26 around the hub areas. There is no red brick cheat to turn on an indicator in this game either. Fortunately, in the PS4 "remaster" they added collectible sound effects to be output from the controller. This is massively helpful as you hear clear as day if there is something like a character token or student in the room somewhere.
Unfortunately this game is rather glitchy. When I was down to 1 left and had to retread the entire Hogwarts castle, multiple times I had the controller making the "student in peril nearby" sound, when a quick check of the above guide proved that there was never a student in that room in the first place, let alone that I had already rescued them. (This happened to me in the Clocktower specifically in the Time Turned version)