You can use spring loaded hinges or install a door closer. This will slow the door down before it slams. If the door is closing on it's own, mostly likely it's out of plumb. You can bend the hinge pins slightly to give some resistance.