How to add the sidebar to all the pages except the home page? [closed]

I don’t know if I understand you correctly, but probably in the file which calls get_sidebar():

You could do something like

if ( ! is_home() ) {
    get_sidebar();
}

Or in your header.php where the main-element starts (which probably wraps the sidebar). You could give it a class if the page is not the home page:

<!-- body and header-stuff -->

<main class="<?php echo is_home() ? 'home-without-sidebar' : 'with-sidebar'; ?>">

<!-- other stuff -->

<?php
    if ( ! is_home() ) {
        get_sidebar();
    }
?>

And then define CSS accordingly:

.home-without-sidebar {
    /* whatever properties */
}
.with-sidebar {
    display: grid;
    grid-template-columns: 20rem 1fr;
    /* more properties here */
}