Photoshop introduced a feature to generate assets automatically from your layers by giving them a specific name (see more here) with File > Generate > Image Assets, but the rules for naming the files are… complex. So now there is a friendlier way to do this through File > Extract Assets, which gives you a GUI interface for doing the same thing.
- Select the layer or layers you want to extract
- Choose File > Extract Assets, or right click on the layers panel and chose extract assets from the contextual menu.
- The Extract Assets Dialog box shows up
- Follow instructions to set up asset extraction.
- Photoshop will automatically name the layers for you