can someone tell me which sentence is correct?

how did you? or how you did it?
Question: How did you do it?

Statement: I wonder how you did it.
These are not sentences, rather, questions.
No one of them is correct, sorry to say this.
Just say: how did you do it?
"How did you?" is correct, and implies the following:

"How did you do it?" which is correct and more complete.

"How you did it?" is incorrect.
'How did you?' cannot be construed as correct in any but the very limited circumstance in which the action verb (or the dummy 'do') appears in the same context:

'I heard you found it! How did you?'
Teachers: We supply a list of EFL job vacancies
Mister Micawber'I heard you found it! How did you?'
The structure is reminiscent of one from my childhood:

"How could you?!" (Mother, in response to one of my evil acts)
Hey, firstly i wanna introduce myself, I'm Alyson Marissa and I'm from England, so my native language is English. Let's get back to the point now; "How did you do it?" is correct in conformity with grammer but sometimes we can use "how did you?". Actually it depends on what you are talking about.
Welcome to English Forums, OCG, Thanks for joining us! [<:o)]

I'll try to do better sticking to the point! Emotion: embarrassed

Best wishes, - A.
Site Hint: Check out our list of pronunciation videos.