Active and Default state

Hello! I was wondering what do i have to do so that when a new menu item is clicked, it takes on the active state, while the previously active item resets to its default state.

Thank you!