http://www.iep.utm.edu/leib-met/5. Necessary Being
The complete concept of Caesar, according to Leibniz, cannot explain itself in its entirety. Expressed ontologically, this means that Caesar himself provides no explanation of why Caesar should have existed at all--Caesar is a contingent being. "Contingent" here simply means something that could have been otherwise; in the case of Caesar as a being, then, it means something that could have not existed at all. The principle of sufficient reason must not only apply to each predicate in the complete concept of a subject, but also it must apply to the concept itself in its entirety as the concept of an existing thing. Thus, there must be a sufficient reason for why this particular substance, Caesar, exists, rather than some other substance, or nothing at all.
What, then, sufficiently explains a contingent being such as Caesar? Possibly other substances, such as his parents, and they in turn are explained by still others? But the entire course of the universe, the total aggregate of substances across space and time, are one and all contingent. There are other possible things, to be sure; but there are also other possible universes that could have existed but did not. The totality of contingent things themselves do not sufficiently explain themselves. Here again, the principle of sufficient reason applies. There must be, Leibniz insists, something beyond the totality of contingent things which explains them, something which is itself necessary and therefore requires no explanation other than itself. (Note, however, that this does not assume an origin or beginning in any sense. Even if time stretched infinitely into the past, there would still be no explanation for the total course of things.)
God, according to Leibniz, is the necessary being which constitutes the sufficient explanation of the totality of contingent things--why the universe is this way rather than any other. Thus far, God's necessity is the only thing mentioned about such a being (there is not much religious or theological about this initially bare metaphysical concept). God as a being may be necessary, but if the contingent universe were simply a random or arbitrary act of God, then God would not constitute the required explanation of all things. In other words, God must not only be necessary, but also the source of the intelligibility of all things. It must be possible, therefore, to inquire into the reasons God had for authorizing or allowing this, rather than any other, universe to be the one that actually exists. And if God is to be the explanation of the intelligibility of the universe, then God must have access to that intelligibility, such that God could be said to know what it is that is being allowed to exist--that is, God must have the ability to grasp complete concepts, and to see at once the "whole demonstration" discussed above. God so far is therefore (i) a necessary being, (ii) the explanation of the universe, and (iii) the infinite intelligence.
https://plato.stanford.edu/entries/sufficient-reason/#WhatSuffReasLeibniz presents arguments for the existence of God from the PSR in a number of different places (for example, The Ultimate Origination of Things, G VII 302–3; L 486–8. Monadology §37). Suppose that God does not exist. If God does not exist, then the only things that exist are contingent beings. Would the entire series of contingent things have an explanation? The explanation of the entire series cannot be a member of the series since then it would explain itself and no contingent thing is self-explanatory. But the explanation cannot be outside of the series because we have assumed that there is no non-contingent being, i.e., God. Thus if God did not exist, there would be something unexplained: the series of contingent beings. Everything has an explanation. Therefore God exists.