When you become stuck on a problem, try for another 15 minutes, and then you must ask.
Document what you try. It becomes a guide that may lead you to the answer. If not, it certainly leads to a better question.
The temptation to immediately ask an expert is tantalizing — but resist! The documentation of your effort serves as a guide for mentoring and teaching.
More importantly, you earn the trust of those experts that you go to them on matters which you've already put effort into solving yourself.
Some of the time in that ~15 minute buffer, you will find the answer yourself. Knowledge gained by trial can often be stronger than knowledge from tutelage. Sometimes, you will even learn something that no one else knows. This is one of the greatest feelings, and often bears incredible fruit.
After all, experts are just people that have already tried and failed a lot.
Any sufficiently advanced form of expertise should look similar to trying a lot — and failing a lot. The best experts become intimate with this feeling. They may even revel in it.
(This writing was inspired by a director of software engineering at Google.)