How can I patch the kernel before building?

I want to apply a small patch to the kernel before building, how can I do that?