A few weeks ago, I finished my undergraduate research project. I had 2 supervisors for the project: One supervisor signed off on everything I did and gave me the opportunity to work on the project. He was my official supervisor. The second supervisor oversaw all of my work, assigned tasks, and graded my work. I would like to thank both of them since this was an incredible opportunity, especially when applying to graduate school. I also plan to keep in contact and use them both as references in the future. How should I go about thanking them and what should I say?
You have the options already mentioned: sending an email or visiting them in person to say thank you.
However (like me), you might be a little unsure of what to say when speaking face to face. In this case, a handwritten note or card would be a nice touch, as it's more personal and permanent than an email.
You might want to ask for a reference at a later date, nearer to when you submit your applications. As Prof. Santa Claus says, if the project went as well as you describe, I see no reason why they would refuse.
A heartfelt email would suffice or simply thank them in person. Everyone likes to know they have done a good job. You only need to validate that.
I wouldn't go in with the objective of securing a reference letter. Otherwise, you would sound insincere. If you have done good work and had the right attitude whilst working with them, they would be more than willing to write one.