These statements can be questions or declarations. For example:
How to say "hello" in Chinese: nihao
How to make a cake: step 1 - add flour and salt to bowl and mix.
The inflection of one's voice in spoken English helps to determine if it's a question.
These statements are also not complete sentences. As a question, these sentences should include an actor or subject: "How do you say "hello" in Chinese?" and "What is one to do in such a situation?"
Likewise, in a question, the subject and the verb often change places, whether or not you're using an interrogative pronoun or adverb (who, what, where, when, why, how). Consider the following:
Do I have to do this?
How do I make soup?
Versus
I do have to do this.
That's how I make soup*.
*using the adverb how usually means you need to explain it further, or you would say "That's how I make gazpacho" without explaining it further because you had already explained it in previous sentences. It's not a phrase that would stand on its own.
Both examples you originally gave are not grammatically correct, but may appear informally. Try to include a Subject, Verb, and direct Object in all sentences, and remember that statements are usually SVO and questions are usually [interrogative adverb]VSO, and that verb is usually a modal or auxiliary verb (do/does/did, can, may, shall, will, would, etc.).