Here is a line, "The optimal output in OT need not be the ideal candidate in the sense of complying with all the constraints." (quoted from Roca and Johnson (1999:656). I really feel confused about this sentence. Can you give any examples?
They are explaining how the optimal candidate isn't necessarily a 'perfect' candidate, as it will likely still not comply with some of the constraints. But what makes the optimal candidate optimal is not that it violates NO constraints, but violates the LEAST NUMBER OF constraints -- also accounting for constraint ranking, e.g. in a hypothetical example where we have only two candidates, with one violating the highest rannked constraint, and one violating the lowest ranked constraint, the one violating the lowest ranked constraint is the optimal candidate.
I find the Wikipedia article gives a fairly good overview of this: https://en.wikipedia.org/wiki/Optimality_Theory
In phonology, one problem with demonstrating this is that there is little agreement on what is in the universal set of constraints. It is widely assume that there is some scheme of segment-penalizations where every occurrence of a segment receives a star, and that is why every segment can in principle be deleted in some language. If every representation satisfied the constraint *Segment (for all segments) then every segment in all languages would delete and we would stop talking. If you interleave constraints that demand that you keep every segment, and if you state a logical priority between the two kinds of constraints, then violation of one of the constraint types in a segment is "less important" than satisfaction of the other constraint type for that segment. We could reduce the theory to saying that UG supplies the constraints "*p, *b, *m, Max-p, Max-b, Max-m". In that ordering, all of p,b,m would delete (satisfying the segment-prohibition constraints, but violating the segment-retention constraints) -- every outcome violates at least one constraint, a constraint that is less important that "the other" constraint that it satisfies. Whatever order you put those constraints in, any outcome violates some constraint.