More effective than a thank you(which you should definitely do) is checking in with them even after you graduate High School
My kids wrote handwritten notes after the acceptances were in. It made it easier to write gushy letters. We gave gift cards to Barnes and Noble. And my younger son (who liked to bake) also made cookies. Don’t forget the guidance counselor, my younger son’s GC apparently had never been thanked, and she called us up in tears she was so honored to have been remembered. (This kid got into some reachy school’s and felt that her letter must have helped.)
My daughter had one teacher who was very supportive of her going to Wyoming (we were in Florida) so she got him a coffee mug and some swag when we were at orientation (there was a ton of swag). One thing was a ‘stress ball’ that wasn’t a ball at all but the mascot (Cowboy Joe). It was just for fun and he really liked it. The next year another kid from that high school also went to Wyoming so maybe seeing the stuff in the classroom inspired another student?
My sister teaches grade school and loves the Starbucks cards. She writes the name of the student who gives it to her and when she uses it she thinks of that student.
As noted above by twoinanddone, a coffee mug can make a great gift. I would just add that subject specific mugs can be found online. A Shakespeare themed mug for the English teacher that wrote a recommendation or a mug with a geometry pun emblazoned around the mug for the math teacher. Then there are the “best teacher ever” type mugs. My kids sometimes filled them with candy and always included a personalized note. When one teacher was not a coffee drinker, and my kid noticed that she was Pepsi drinker, then the gift was a Pepsi branded tumbler. The more personalized the better. Sometimes the teachers even wrote a thank you note for the the thank you gifts my kids gave.