Properly working pegs aren't normally a problem. But if you have a problem with the wood pegs slipping, you'll need to apply a few peg drops.
Get the string up to relative pitch. Insert peg and wipe off excess liquid or compound from peghead. If the peg seems to pop out, especially when it's been sitting in your case for some days, it probably has to do with temperature change and the quality of contact. Check if the peg is making good contact all the way around. Good contact is indicated by an even, shiny, burnished surface, 360 degrees, where wood meets wood. Pegs, being made of wood, naturally tend to shrink across the grain as they get old. Pegs can thus become oval in section with age, meaning they no longer contact fully all the way around. Use peg drops to ensure that the wooden pegs do not slip, settle in properly and hold perfect pitch. If still this doesn’t help, the best thing to do is get a qualified luthier check it out, to ensure your pegs match the hole perfectly.