Since when have you been feeling like this? Has it been a regular affair or has this been bothering you over say months or a year or years? How intense are these feelings and how frequently have you been experiencing such thoughts?
Next Steps
You can consult a psychologist initially and get yourself assessed (no medications would be prescribed). This might be happening due to various factors, depression might be among the many causes due to this feeling of inadequacy. If your symptoms are not clinically significant, psychotherapy might help but in case the intensity of such feelings are stronger so as to cause social occupational dysfunction, you might need to see a psychiatrist as well for medications.