What to do when a professor agrees to write a recommendation letter but doesn’t?
Ask someone else now.  Provide a specific date, e.g. June 10, by which you need the reference and explain why.  You can almost certainly add another referee to your application.  If, for whatever reason, you cannot add another referee, cancel the one that's outstanding as soon as another professor has agreed.

If you can add a referee without canceling one, write to the professor who has already agreed and give her a deadline, also explaining why.  (NB: Professors are necessarily pretty good about meeting deadlines, and often abysmal at those things that do not have deadlines.  This from extensive research on a sample of one, namely Yours Truly.)