The family of a soldier who took his own life at a North Yorkshire military base said they believe his death “could have been prevented”.