Multiscale or multiphysics partial differential equations are used to model a wide range of physical systems with various applications, e.g. from material and natural science to problems in biology or engineering. When the ratio between the smallest scale in the problem and the size of the physical domain (also the size of the solution) is very large, the numerical approximation of the effective behaviour with classical numerical methods, such as the finite element method (FEM), can become computationally prohibitive. Indeed, as the smallest scale in the problem has to be fully resolved, one obtains a discretization of the computational domain with a very large number of degrees of freedom. In the first part of the thesis, we derive a finite element heterogeneous multiscale method (FE-HMM) applied to the wave equation in a linear elastic medium. We state the FE-HMM and give robust a priori error estimates with explicit convergence rates for the macro and micro discretizations. For simplicity, we start with the static highly heterogeneous linear problem and, then, add the time dependency and consider the wave propagation in a highly heteorgeneous linear elastic medium. In the second part of the thesis we are interested in problems in which the scales are well separated only in some regions of the computational domain, with possibly a continuum of scales in the complementary domain. Such problems arise in various situations, for example in heterogeneous composite materials whose effective properties can be well captured by assuming a (locally) periodic microstructure that can however not be valid near defects of the material. In our modeling, the smallest scale is supposed to be still discretized at the continuum level, but for some applications atomistic scale should be considered. Our coupling method is based on a domain decomposition into a family of overlapping domains. Virtual (interface) controls are introduced as boundary conditions, and act as unknown traces or fluxes. Our method is formulated as a minimization problem with states equations as constraints. The optimal boundary controls of two overlapping domains are found by an heterogeneous optimization problem that is based on minimizing the discrepancy between the two models on, at first, the overlapping region, and at second, over the boundary of the overlapping region. The fully discrete optimization based method couples the continuous or discontinuous Galerkin FE-HMM with the FEM. The well-posedness of our method, in continuous and discrete forms, are established and (fully discrete) a priori error estimates are derived.