Google Maps Pro showing one popup at a time

Hey, I want to show one popup when user click marker on the map. It should close the other popups when you use any marker to show its popup. How can I achieve that?