Unforunately you won’t likely know if you can resolve an issue until you attempt to resolve an issue. This isn’t something that only junior programmers have issues with, I still have this problem. Unless I happen to already know the fix, I can never be certain how difficult an issue will be to resolve. I’ve spent weeks on “simple” issues and hours on “difficult” ones.
One of the goals in resolving challenging issues to structure your work to hopefullly have useful progress along the way. This might be preliminary test cases, or perhaps improvement documentation. At the very least you should be learning something.
There’s also nothing wrong with backing out of a difficult fix. I still frequently abandon work since I realize quite late that it isn’t the right direction.
