Wheel Bearings coming loose

What process did you use to tighten them? If you didn't preload them, install the castle nut and cotter pin it they will loosen.