How we can transform data from wide dataset to long data set?

By using tidyr::pivot_longer()

https://tidyr.tidyverse.org/articles/pivot.html

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.