Line two baking sheets with parchment paper (do not place the cookies directly on the baking sheets, they will spread too much).
Beat butter and sugars for 1minute until light and creamy. Add egg and vanilla and beat to combine, scraping the bowl if necessary.
In a separate bowl, combine flour, baking soda, baking powder, cinnamon and salt. Add the flour mixture to the butter mixture and beat on low until just combined. Add the oats, coconut, carrots and walnuts (if using) and mix until just combined.
Place the dough in the refrigerator for 30 minutes. Meanwhile, preheat oven to 350°F.
Scoop the dough into 2-teaspoon sized mounds and place a couple inches apart on the cookie sheets (make sure they are mounded and not flat). Ensure that the cookie dough mounds are similar in size so that cookies will bake up the same size.
Bake for 9-11 minutes, until golden brown and still slightly underdone in the center. If necessary, rotate your cookie sheets halfway through the baking time to ensure even baking. Optional (for perfectly round cookies): immediately after the cookies come out the oven place a round glass, bowl, or cookie cutter (larger than the cookie) upside down over the top of the cookie and gently but quickly swirl the glass/bowl/cookie cutter in a circular motion. The edges of the cookie will bump against the inside of the glass creating a perfectly round shape. Note: This only works when the cookies are hot, straight from the oven, and still on the warm baking sheet.
Cool the cookies completely on the baking sheets. Repeat with remaining dough, chilling the dough between batches and allowing the baking sheets to cool completely before adding the next batch of dough.
Once the cookies have cooled to room temperature, place the baked cookies in the refrigerator for 20 minutes. This will help them firm up and make them easier to handle when adding the frosting.