Light painting is a photography technique that uses a moving light source (such as a flashlight, glow stick, smartphone) to alter the image while taking a long exposure photograph. A long exposure is key for this technique because it allows you to create a ‘painting’ with the light source. You want a long exposure of up to 30 seconds or more.
To achieve a longer time, you can set the camera to bulb mode, which means the camera will keep taking the photo until your finger leaves the shutter button. It is important to have a tripod or a stable surface to achieve the desired effect.