How can I set brightness on my LED

Resistor needs to be in series with the LED to prevent damage to the Arduino output pins - I use 470 ohm ones since I don't need bright for test and learning - on actual projects I adjust the value to get the proper brightness or limit the current so as to not damage anything - depends on the LED -

I am assuming you are using the standard 5mm ones that come with most starter packages