Being a mentor does not require you to be an expert or to know all the answers. Sometimes it's just enough to be patient, perceive others problems from a different angle, and give sincere advice.
I consider myself lucky to find a good mentor who helped me go through the process of learning web development. From zero knowledge to getting the first front-end job reasonably quickly, in just half a year, and made a good friend.
Knowing how it is crucial to have a mentor, with a little bit over two years of experience in development, I had opportunity to be a mentor myself, for someone going through the same path as I did. And soon enough, experienced the benefits of it.
Usually helping others will get more benefits for yourself. One of the advantages that kept me motivated is giving back to the community. The development community is firmly based on the open-source, sharing knowledge and helping others. By teaching and advising to the less experienced persons, you contribute to the community and not only consume but also produce.
Another gratifying feeling, personally for me, is helping and doing good for others without expecting to get anything back. It gives some purpose and meaning to life and makes you happier when you know that you made a positive impact on others life.
Learn more by teaching. To teach, you have to know the topic well and forced to prepare in advance, re-learn, and revise the basics to be able to explain it easily. It is an excellent way to test your knowledge if you know the topic well - try to teach it to someone. Also be ready for questions, like why, how, and when.
I had a tough time explaining about React, and for sure wasn't prepared for questions about how its internals works and why. It forced me to explore and do extra reading to know the ins and outs of the framework, which deepened my knowledge and paid off in the long run.
Nevertheless, you will have to learn how to explain complex topics easy to understand.
As you spend more time with another person, you will likely make friends. That's happened to me, by this day keep in touch. Also, the person who you teach will feel appreciated, and who knows, in the future might return the favor. So partially you could look at it as an investment.
If you doubt your expertise and experience to mentor others, remember that you need to be just one step ahead, to know a little bit more, and someone can benefit from it. You don't need to be a guru of the field, and I bet you have something to teach and guide others. And being a mentor, sometimes just need to observe and give advice from a different perspective, as usually, we are shortsighted from our own.
If you decided to try, think of the skills you possess, are passionate about and willing to share. Then look for persons in need, for example, start from your workplace, as the junior developers. If you are junior yourself, know that there are a lot of persons trying to learn development and going through the same path as you did, so you might also try to get your message out in forums, meetups or friend circle. I got contacted and asked for help when told my inspiring story of carrier transition during the class reunion, so you never know. Just be sure to find the right person, who is sincere and not lazy, you wouldn't want your time to be wasted.
Mentorship is very rewarding. You are growing together with the person you help improve. You learn things you have to explain more in-depth, and that makes you an expert in it. And who knows, helping others might give you a new meaning for life.