i just went through this process! i was SO anxious about asking. but it turns out most profs are willing to do it even if they don’t remember you specifically. as long as you did well in their class ofc. mine said he’d love to write one, and just asked me to provide him some info to include