Problem and Solutions
Change color of icon in toolbar when click in android ?
By M.K. Verma · 4 May 2022

You could create a global Menu variable and initialize it in the onCreateOptionsMenu() and then use it in your onClick().
private Menu menu;
In your onCreateOptionsMenu()
this.menu = menu;
In your button's onClick() method
menu.getItem(0).setIcon(ContextCompat.getDrawable(this, R.drawable.red_heart));