I guess this could be titled, "How to prosecute a president and, when to do it."
In this case, that means Deputy Attorney General Rod Rosenstein, since Attorney General Jeff Sessions has recused himself. So, if Trump wants Mueller fired, he has to order Rosenstein to do it. But that's where things could get messy and lead down a similar path to President Nixon's Saturday Night Massacre, when multiple Justice Department officials resigned rather than follow his orders to fire the special prosecutor.
There are indications that Rosenstein might resign if ordered to do this: he reportedly threatened to quit over how Trump handled firing FBI Director James Comey, and during a hearing before the Senate Appropriations Committee he said of firing Mueller, I'm not going to follow any order unless I believe those are lawful and appropriate orders "If there were not good cause," it wouldn't matter to me what anybody says.