I used the ArtStudio app to create the images in this guide. But the same general steps apply to most image editing programs such as photoshop and other drawing apps.
The program or app must have layers, guassian blur and the ability to adjust opacity. Most decent paint programs and apps have these features.
Start out with a background layer. Then add a blank layer over it. This is the layer we'll add our image we want to add a shadow to.
In this example I'm going to make a ball. So create a circle.
I'm going to fill my circle with a Radial Gradient to create a nice 3D black ball. The gradient will give it a glare of light.
Here's the ball after the radial gradient is applied. You can use any image or shape you like. But the background of the layer must be transparent. Deselect the circle.
Next you'll want to duplicate the layer of the object (ball in this case).
Then select the bottom of the two object layers. The top one is the object and the one below it will become its shadow.
Move the "Shadow" layer downward.
So you end up with the shadow layer slightly below the object layer. In some cases you'll want to fill in the entire "shadow ball" solid black. But in this case we don't need to.
Add a Gaussian Blur to the shadow layer.
Adjust how strong of a blur you want on the shadow layer. You want it to look like a shadow of the object.
Then move and scale the shadow layer to the position that looks best.
The same process can be done with any shape.
Different positions, size and opacity of the shadow layer will create different lighting effects.