Work with your manager to institute a formal code review process. There are many free software applications out there, or you could make it as part of the pull request process when using git.
When doing a code review, don't be pedantic. Don't nitpick small, trivial details like whitespace or alignment. You should use an automatic code formatter that triggers when the code is saved in the ID or as part of a precommit hook. This also includes Linters with automatic fixers (for example, if you're using mixed quotes, it should automatically convert them all to the same type. Reduce the stress on your developers to memorize everything)
Encourage your team to do more peer programming or a "watching" code sessions. A lot can be learned from simply watching how some uses the terminal like new commands and techniques. Allow them to interrupt and ask questions like "what's joe" or how did you get your git log to show that?
Take this as an opportunity to walk through critical thinking process together. Like walk through the steps you go through to solve a problem.
Don't be Condescending: Most developers already have imposter syndrome, berating and belittling them only reinforces it and demotivate your coworker.
Celebrate the little wins: It may sound stupid, or undeserved, but compliment your coworkers regularly for small achievements and recognize how they are important part of the team. You may say "but I only compliment people when they really deserve it or people will think its fake" numerous studies in management theory show quite the opposite, productivity goes higher and people go the extra mile to meet your requirements.
Think like a mentor, not like a teacher. Think about how we can improve this coworker like a team with that member. Be willing to be a fount of information or a reference. Point them to the line number of documentation they should be looking at. Show them how they can teach themselves to be better (blogs you read, share reddit posts, tutorial videos, or O'reilly books you found really valuable to read). It may seem pedantic, but do sit down with them and patiently show them how you go through your thought process for googling problems. Start an office wide, "best programming books list" and get your manager to buy them and have them in an office library. Define clear coding practices your office adheres to.
When all else fails, find a new job. Maybe its a reflection of your work environment and that you've outgrown it and may be time for you to look for new works. If you feel like you're the smartest person in the room, its time to find a new room.