And then, put effort into your question:
- explain clearly what you've tried, and how it didn't work
- link to other resources that appear on the surface to be the answer, but really aren't because of x, y, and z reasons.
- provide code! don't just dump a metric tone of it in the answer though, provide only what is necessary to demonstrate the problem. if for some reason you can't provide the actual code for IP reasons, try to reproduce the problem separately with a very minimal example. for larger code samples, linking to Github gists or repos is a good idea.
I've asked very few questions over the years, and one of the main reasons is because I ended up finding the solution myself; the steps above force you to review your own work thoroughly, and lay out the problem clearly, so you might catch a mistake that wasn't obvious after cursing at your screen the first time around.
For those questions that I have asked, I've never been downvoted or had the question closed; at most no replies but that was it. If readers see you put in effort to ask a question, then they are also more inclined to put in effort to help.