Convert HTML code to WordPress menu

If you want to display a custom menu, you need to use the wp_nav_menu function. I’m also assuming you have registered a custom menu with the register_nav_menus function eg:

register_nav_menus(
   array(
      'main-menu' => 'Main Menu',
   )
);

A basic example would be

wp_nav_menu(array(
   'menu'            => 'Main Menu',
   'theme_location'  => 'main-menu',
   'container'       => 'nav',
));

Change theme_location to match whatever you set in register_nav_menus.