Making sure to use a well-buttered or greased pan is key. Spraying the pan with nonstick cooking grease or rubbing it down with butter will help to get your treats out of the pan every time. In the worst-case scenarios adding a sling of wax paper to the pan could also help to pull up the treats when ready to slice.