You can serve as a foil to someone if you show them to be better than you by contrast. If you can't dance but your friend Lisa can, you can be a foil to Lisa's grace.
If you're having trouble remembering this definition, think about a shiny piece of tin foil. It reflects an image back to you, so if you're a foil to someone, their image is reflected off of you in a positive light. Your brother's mediocre grades might serve as a foil to your intelligence. As a verb, if you foil someone's plans or attempts to do something, you cause them to fail. Your brother will be really mad if you foil his plans to hide his mediocre report card from your parents.