The best thing you can do is post a Minimal, Complete, and Verifiable example, also known as a Short, Self Contained, Correct (Compilable), Example. Both links contain a bunch of great pointers on asking a good question.
But basically, you need to narrow down your problem to as few lines as possible while still including enough information so we can copy and paste your code to run it on our machines and get the exact same result as you.
What I often do is start over with a blank project, and only include stuff that directly relates to the problem. If I'm asking about functionOne()
, no need to include functionTwo()
. On the other hand, potential helpers shouldn't have to do anything to my code in order to run it. That includes import statements, any properties required, etc. Hardcode as much as possible.
This can be a pretty annoying process, but it's also the process you should already be doing on your own in order to isolate the problem. Get in the habit of working in small chunks, and this becomes easier.
You should also include specifically what you expect your code to do, what it does instead, and what the difference between the two is. Try to narrow it down to a specific line that's not working how you expect it to. Debugging and print statements come in handy here.
The name of the game is: make it as easy as possible for people to help you. Include everything needed to reproduce the problem, but don't include anything that isn't directly related to the problem. Any less or more just makes it more difficult for people to help you.