A recommendation letter is a crucial part of any application. It works as an endorsement by those who personally worked with you in order to reinforce aspects you've highlighted in your application. Watch out for the following red flags while you ask someone for a recommendation letter.
“Can you write me a recommendation letter by tomorrow?"
This screams insincerity. It makes you look like a lazy procrastinator who waited till the very last minute to apply for a role. Not just that, this is also extremely disrespectful to the person you're asking, because it seems like you are assuming that the person just happens to have all the free time in the world.
"I asked X to write me a recommendation letter but he refused. Will you write me one?"
There are many things wrong with this one. Firstly, it looks bad on you, because nice, capable people don't usually get rejected when asking for a letter of recommendation. Secondly, it looks bad on the person you're asking, because let's face it, nobody wants to be anybody's second choice.
"I know we haven't really interacted much, but I would really appreciate it if you wrote me a recommendation letter."
This is perhaps the most desperate attempt at trying to get a letter of recommendation. It makes you look like somebody who has made no meaningful connection with people in their professional field and will be happy with a random letter written by a random person about a random 2-minute encounter. More importantly, if they do agree to write you that letter, it will probably not be a convincing one.
"Can you please send me the letter before you email it?"
This makes it very obvious that you're worried about the quality and/or content of the letter and would just like to ensure that they aren't going to embarrass you with their inferior writing skills. It's better to not ask somebody for a recommendation letter if you don't have faith in their abilities to write you a good one.