I think you would use tidyverse/tidyr's pivot_longer function. For more detailed support please take a few moments and make a reprex.
pivot_longer