Technically, they all contain valid English grammar, but the third sentence is the only one that is a 'good' sentence. The other two are far less likely to be published in any significant formal document in their current state.
The first two sentences are of a poor quality because they lack an expected level of context, where as the third sentence is of a decent quality because additional context is not expected to be provided within that sentence.
Why do the first two sentences lack context?
In colloquial usage worldwide, the phrase 'someone who knows what they are doing' typically refers to someone who has all-round general competence within a broad area, not just limited to some specific detailed task. Where as 'someone who knows what to do' would be expected to refer to someone who is skilled in a very specific task/procedure, but there is no reference to such a particular task/procedure in those sentences, so those sentences lack clarity, they could be called 'fragmented', thus they are of a poorer quality (in formal usage at least). They still technically contain valid English grammar, but are poorly written nevertheless.
Why is further context expected within the sentence, rather than potentially being provided in previous sentences?
A full stop (a period) is meant to denote the end of a full concept, and the concept hasn't been written descriptively enough in the first two sentences in order to bring enough certainty of understanding. Additional words are needed before the end of each of those sentences in order to confirm whether or not a specific task is being referred to, or if the meaning is more general (as in the third sentence).