The fact that individuals will most likely behave differently in different situations begets the introduction of conditional strategies. Inspired by this, we study the evolution of cooperation in the spatial public goods game, where besides unconditional cooperators and defectors, also different types of conditional cooperators compete for space. Conditional cooperators will contribute to the public good only if other players within the group are likely to cooperate as well, but will withhold their contribution otherwise. Depending on the number of other cooperators that are required to elicit cooperation of a conditional cooperator, the latter can be classified in as many types as there are players within each group. We find that the most cautious cooperators, such that require all other players within a group to be conditional cooperators, are the undisputed victors of the evolutionary process, even at very low synergy factors. We show that the remarkable promotion of cooperation is due primarily to the spontaneous emergence of quarantining of defectors, which become surrounded by conditional cooperators and are forced into isolated convex "bubbles" from where they are unable to exploit the public good. This phenomenon can be observed only in structured populations, thus adding to the relevance of pattern formation for the successful evolution of cooperation.