If you need a letter on short notice, you should strongly consider asking someone else (Ravi Vakil).
The first thing you do is ask me. If you do this by email, please make sure you tell me what the recommendations will be for and the deadline(s).
Presumably you want me to write about your research. The best thing to do would be to meet up with me and describe your research. Try to explain an argument or a result you are particularly happy with. If we cannot meet, try to point me to such an argument or result in one of your papers.
This is very important to me and often goes awry or applicants seem to forget. I want to know that I have all the information relevant to your case. Here is a list of things I want you to send me by email and I want you to keep updating this as time goes by and we get closer to the deadline:
Once you have sent me an email with all this information once, it should be an easy matter to update this email whenever new information becomes available; if you have a good email client it should be possible to send those updates in the same email thread! Please make sure I know at each moment what the most up to date information is.
Please remind me of deadlines by sending me frequent emails, with increasing frequency as the deadline gets closer. The first reminder should be sent about 14 days before the deadline.