How the legend appears on the map really has to do with what you want to do with the map. You have different options depending on your goals. As stated above, in Map Viewer you can click the legend button to see the legend. Beyond that, what would you like to do with this map?
Do you want to print the map?
Do you want to create a web app?
If you want to create a web app you have options including using Instant Apps, Story Maps, Experience Builder, and more.
For instance, you might want to create an Instant App with the Interactive Legend template. Interactive Legend is a configurable app template where the core functionality revolves around an interactive filter tool.
Steps:
1. Create and save a map in Map Viewer
2. Click the Create App button
3. Select Instant Apps
4. Locate Interactive Legend and click Choose
5. Go to Step 3 | Express: Configure the legend style. You can choose between styles like Floating or Side panel, and choose a location for your legend.
6. Publish the app.
7. Launch the app.
This launches an app containing both a map and a legend that allows user to explore feature layers in the map by interacting with the legend.
For more detailed information, please see this blog article on Interactive Legends. Hope this gets you pointed in the right direction!