How can I add custom sidebar to my theme? [closed]

You need to register the widget area in your themes functions.php file. Your code should look something like this.

//register the widget area
function your_function_name() {
     register_sidebar(array(
         'name' => esc_html__('Sidebar', 'your_theme_name'),
         'id' => 'sidebar-1',
         'description' => esc_html__('Add widgets here.', 'your_theme_name'),
         'before_widget' => '<section id="%1$s" class="widget %2$s">',
         'after_widget' => '</section>',
         'before_title' => '<h2 class="widget-title">',
         'after_title' => '</h2>',
     )); } 

add_action('widgets_init', 'your_function_name'); //This hooks into WordPress wigets_init function.

You can learn more about widgetizing themes here. Another great place to learn and understand hooks, actions and filters is this site, it really helped me out. I hope this all helps. =)