I'd say both based on how long you've been a developer. If your just starting out - yes, try to figure it out. You'll build problem solving skills and appreciate learning something more then someone just giving you an answer.
Once your seasoned / experienced - yes, go for Google. Deadlines need to be met and stuff needs to get done. Understand the solution given to you by others and don't just copy and paste code from SO or here, but if it's waste 5 hours early in a project or Google for 30 seconds and move on - Google and move on. If you can, go back later and understand why the solution was given and why it worked.
Me, personally, if I'm going to Google, it's usually cause I've forgotten a specific function / method or I've become code blind and having a syntax error and I need verification that what I'm trying to do is actually the right way to do it.