Preheat your oven to 350°F (175°C) and line a baking sheet with parchment paper.
In a mixing bowl, combine the all-purpose flour, cheddar cheese, Parmesan cheese, salt, black pepper, and cayenne pepper (if using). Mix well.
Add the softened butter to the dry ingredients and use a spatula to mix until the mixture resembles coarse crumbs.
Stir in the finely chopped jalapeños. Gradually add cold water, one tablespoon at a time, and mix until the dough comes together. You may not need all the water.
Transfer the dough to a lightly floured surface. Use a rolling pin to roll the dough to about ¼ inch thick.
Use a cookie cutter to cut the cookies into your desired shape, or simply cut them into squares with a knife.
Place the cookies on the prepared baking sheet, leaving space between each cookie.
Bake in the preheated oven for 20-25 minutes or until the edges are golden brown.
Remove from the oven and allow the cookies to cool for a few minutes before transferring them to a wire rack to cool completely.