The best that a knowledgeable and well intentioned doctor can do is prescribe them in a trial and error fashion, maybe with a tiny bit of guidance from prominence of patient symptoms. But it's largely just prescribe, wait 6 weeks, rinse and repeat. I happen to be one of the 'treatment resistant' types, in that SSRIs don't do jack-squat for me (well, except for when there's a drug-drug interaction, and that's definitely not the 'good kind' of effect).
The medical literature suggests SSRIs are only just barely more effective at treating depression than placebo. There's also an interesting (and in my view, plausible) explanation behind why SSRIs might cause an initial increased suicide risk. A common symptom of depression is 'psychomotor retardation': "a slowing-down of thought and a reduction of physical movements in an individual" (https://en.wikipedia.org/wiki/Psychomotor_retardation). If SSRIs have any positive effect, they occur gradually.
So the hypothesis goes: a patient might be suffering from suicidal depression, but the psychomotor symptoms prevent suicide. When they are prescribed SSRIs, and those SSRIs start having a positive effect, they lift the psychomotor retardation just enough that the patient is finally able to kill themself. It probably sounds a bit strange, but I can attest to how debilitating 'psychomotor retardation' can be.