First off newbie alert I'm new to all this electronics and playing with the Arduino (not new to coding). Eg, I have never soldered anything before... so that type of new. I have to start somewhere I suppose.
So I've picked a little project. I want to try working with the Arduino and LEDs and making them do different things before I try to move into anything more complex.
Ive decided to start at the right beginning and have 1 sole LED ( WS2812B) which I want to be solid red. I have supplied power to the LED and the Arduino which is all good and send my first sketch over (see below).
Currently, you have one led connected? Not a strip of which you are using only the first? If so, you shouldn't need a separate power supply or regulator at this stage. But you could try an electrolytic cap, 10uF+, near the led rather than near the Arduino, especially if the wires are long or thin.
When you change to a strip, that cap should be much larger, e.g. 470 or 1000uF, and you must use quality, thick wires to take the power from the separate PSU directly to the strip, possibly to both ends of the strip.
Also if the wires from the Arduino to the led are long or thin, put a ~500R resistor in the data line, near the led, and make sure a ground line goes in a pair with the data line back to the Arduino.
No, your code is fine. You didn't post a schematic (no fritzing pictures, please), so everyone is just guessing.
Do not power the WS2812 from the Arduino. One WS28xx LED is on the edge of the limit of what power the Arduino +5 pin can provide. The spec for the WS28xx 5V LEDs is "Power Supply Voltage VDD= +3.5~+5.5 V", so three AA batteries in series would work. If you use a good 5V PSU, then you can power the Arduino and many WS28xx LEDs from it.
The spec for the WS28xx chip recommends that you put a 104 capacitor (0.1 uf) across the +V and ground at the first LED. The spec also calls for a series resistor on the data line from the processor to the first LED. "To prevent the reflection and hot-swap protection, we suggest to connect a 33ohm resistor at the data input or output port for impedance."
Most of us ignore the series resistor and many ignore the capacitor. But it can't hurt to include them.
How did you get the "sole" LED? Did you cut one from a strip?