Use subject-verb inversion and do-support with main clauses which ask questions (unless questioning the subject, of course).
Do not use inversion with the corresponding subordinate clauses (indirect questions).
Who was he? / Nobody knows who he was.
What did you put on the shelf? / I don't know what you put on the shelf.
Where has he gone? / I'll bet you can't guess where he has gone.
What is the difference between these methods? / I can see that you have no idea what the difference is between these methods.
Why did he leave everything on the table? / We were unable to determine why he left everything on the table.
Are you concerned that you won't pass the test? / I wonder if you are concerned that you won't pass the test. [Note the addition of "if" when transforming a yes-no question to an indirect question structure.]
When will the documents be ready? / In our office there is complete confusion about when the documents will be ready.
Can you see it? / I have no idea whether you can see it. [Note "whether", which can substitute for "if" in these constructions.]
How much was that package of ribbons? / The clerk had to find out how much that package of ribbons was.
In my experience what bothers learners most about these patterns is a form of the verb "to be" left at the end of the sentence. I don't know why. It is correct!
I don't know [what the problem is / where John was / who the strangers were / how much it is ].