How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?

Sidebar generator plugin is best solution for your logic?

If you would like to add sidebar even in taxonomy or tag, you would need to create meta field or option field for that.

Below example codes is good for static sidebar!

<?php get_sidebar( 'left' ); ?>
<?php get_sidebar( 'right' ); ?>