How to display the featured post on the category page?

The problem is not in code to Displaying Feature post in category page. the problem is to add feature post meta into post.

First, checked() by default echo, so you have to pass false attribute to prevent echo.

function add_featured_meta_box($post){
    $featured = get_post_meta($post->ID, '_featured-post', true);
    echo "<label for="_featured-post">".__('Feature this post?', 'foobar')."</label>";
    echo "<input type="checkbox" name="_featured-post" id='featured-post' value="1" ".checked(1, $featured,false)." />";
}

second, remove esc_attr() from update_post_meta, and you have to save empty value beacuse unchecked checkboxes are not set in the $_POST, so you’d have to empty their meta field.

function save_featured_meta($post_id){
    // Do validation here for post_type, nonces, autosave, etc...
       $featured_post = ( isset( $_POST['_featured-post'] ) ) ? $_POST['_featured-post'] : "";
       update_post_meta($post_id, '_featured-post', $featured_post); 
        // I like using _ before my custom fields, so they are only editable within my form rather than the normal custom fields UI
}
add_action('save_post', 'save_featured_meta');