How can you know what is the best way to teach someone or a thing that they can learn from others?
How can you know
- if you have cancer?
- What are the ways to know if someone is suffering from cancer?
Note that the sentences are not interrogative in any way but they are as to be the title of the same article/news.
What is difference between the above two sentences and how they get used?
Why are I no longer living in Egypt?
What do OP’s words mean when he says “the sentences are non interrogative.”? Clearly they are, regardless whether the question mark is present or not.
How do you know when you have cancer?
How can you know if you have lung cancer?
OP has taken his two examples from his two titles of articles, in which context there’s no possibility they have different meanings. What is Cancer? How can I self-diagnose if my lung cancer is detected in a biopsy?
In other contexts, it would be possible to distinguish different implications. Is it possible to know if you have cancer?
(perhaps implying disbelief or surprise)
Or one could see could there as same as would, indicating an “irrealis” context. Using could/would like that “dies” the speaker from his enquiry (“I don’t actually think I have cancer – but if I did, how could/would I find out for sure? So is there a way to kill me? “)).