I will answer the second part of your question first. When you study string theory in a standard course, the target spacetime is fixed to be Minkowski (or AdS with certain fluxes). Very loosely, the vacua you want to obtain is that of the metric operator acting on it and giving dS, not Minkowski (or AdS), which is clearly not the case. From this viewpoint you can ask what kind of fluxes you want to add which will guarantee you a consistent dS vacua.
Now your first question points to a deeper question, that of whether de Sitter vacua can actually be constructed in string theory. Broadly there are two opinions to this question, and the answer is not clear yet.
KKLT and its variants are a conjectured way of constructing metastable dS vacua in Type IIB. They start with warped Type IIB compactifications with non-trivial NS and RR fluxes. To fix all undetermined moduli in the vacuum they incorporate corrections to the superpotential from gaugino condensation and write down a supersymmetric AdS vacuum. They now put in some anti D-3 branes on top of this vacuum which lifts the AdS vacuum to metastable dS. However this construction isn't rigorously proved yet, and is beset with various problems like existence of tachyons in dS, validity of gaugino condensation, backreaction of anti D branes etc. A clear and detailed study of these complications is given in this paper.
There is another opinion that dS solutions cannot be consistently constructed in quantum gravity and hence falls in the swampland. See (this paper) which puts forward a naive phenomenologically motivated criteria for determining which solutions are in swampland. The way they explain the accelerated expansion of our universe is by invoking quintessence while throwing away all dS constructions to the swampland.