How do I set administrator menu to be the same as this Drupal 7 menu?
To disable the menu shown in your first image, go to Structure > Blocks and disable any menu blocks you don't want to display (e.g., Management, Navigation, User). (Thanks, @leymannx!) 

To have the menu shown in your second image, enable the core Toolbar module.