Multiscale partial differential equations (PDEs), featuring strongly heterogeneous coefficients oscillating across possibly non-separated scales, pose computational challenges for standard numerical methods. In this talk, I will present a multiscale spectral generalized finite element method for solving multiscale PDEs based on our recent works. The method employs optimal local approximation spaces built from carefully-designed local eigenvalue problems, and achieves exponential convergence with respect to the number of local degrees of freedom for general heterogeneous coefficients. It can be used at the continuous level as a multiscale discretization scheme, and also at the discrete level as a model reduction technique. Moreover, when used in a discrete setting iteratively, it gives a two-level hybrid Schwarz preconditioner for linear systems resulting from fine-scale discretizations of multiscale PDEs. The standard GMRES algorithm applied with this preconditioner is shown to converge at a rate of at least \Lambda, where \Lambda denotes the error of the underlying method. Applications of the methods to various PDEs will be presented, including Poisson, elasticity, Helmholtz and Maxwell type problems.