How do I apply different headers to different pages using this template?

// Create header-{SLUG}.php in theme folder and add this line in your header file

 global $post;
    $slug = $post->post_name;
    get_header($slug);