Stop beating yourself up for the things you didn't know, for the poor choices you made, for the opportunities you missed, for the doors you let slam in your face, for the people you let break your heart. We can only do the best we have, with the information we have at the time. We always know more in the future, because in the future, we know how our choices played out, but in the midst of living, we have no way of knowing exactly what is the best choice. If so, then our mistakes were simply a part of what life is. Stop berating yourself for the things you couldn't have known.
Life is a learning process.
Don't tell yourself you are stupid because you made choices that didn't gain the results you wanted or imagined. Pick yourself up, give yourself a mental hug, and walk on. Life is waiting.