This question is rather vague so I'm going to give a higher-level and rather vague answer.
The part of the question that is vague is that you stated a "programming/server configuration problem." You didn't specify chasing a bug or debugging specifically.
So assuming you are trying to code some algorithm or data structure and you hit a wall, what I typically do is search for solutions to similar problems online just to see how someone else went about solving the problem. You can even look on GitHub and see if you can see some source code for a similar problem solution.
Many times, it is about approaching the solution in a way that you were not currently thinking of. For example, maybe you think that you need to A B C when you can really get away with doing D E F, or D B A.
As you gain more programming experience, you will increase your knowledge of how programming problems can be solved in general and you will find that you can sit there without an Internet connection and figure out more ways on your own so sometimes you just need to spend a few hours doing this.
I think this same advice applies for server config as well.
Sometimes going on a walk or doing something completely unrelated will help too and some solutions will pop into your head that you can try.