A man has been freed from a bog by mountain rescue teams while walking on the moors.