Subjunctive/Conditional 2 -Word order and verb forms

Hey, I just have a question about word order, how would the following sentence read in German?:
“I knew what I should have done”

Also sentences like “I should have tried…”
The answer just completely eludes me and I don’t even know what this construction is called or if there is a name for it.

 

(asked by Briguy)