First, you want to make sure that the lens area is not being covered by any objects or dirt. Clean the area properly by wiping with a cloth. If the problem persists, then it is possible that the camera is faulty and needs to be replaced with a new one. Instructions on how to replace the front camera can be found here.