Adaptive optics is used to abate aberrations with a wavefront correction. It is widely used in astronomy and is starting to expand into applications of laser focusing and imaging with high numerical apertures, e.g. microscopy. The physical background of focusing laser light and imaging is the same, so we can use the same methods. In both cases, light is propagating through a lens; either it becomes focused into a small region or light from a small region becomes imaged on a camera. Modulations applied on the lens to implement wavefront corrections behave similarly in both applications. A powerful simulation tool was created to characterize the impact of those modulations. As an example, we validated a design for a Fresnel lens produced on a glass fibre tip to focus its emitting light. We have developed solutions mainly for three different problems. First, a high depth of focus enables keeping a laser beam focused within a larger length or imaging objects from different positions simultaneously. In photography, this can be attained by stopping down the aperture, which introduces a huge loss of light. State-of-the-art for focusing into a line segment also shows an inefficient performance. We present an elegant lens design, which enables highly efficient elongation of the depth of focus. Preliminary studies have shown that it might be a feasible alternative for current intra-ocular lens implants in ophthalmology or for 3D visualization in imaging and microscopy. A high depth of focus also has a large potential in optical lithography and data storage, because the focal position is enlarged and does not have to be adjusted precisely to obtain a useful spot. Second, specimen-induced aberrations can affect even a perfectly adjusted, diffraction limited lens system. A planar refraction index mismatch introduces spherical aberrations, degrading the optical resolution. As a first step to correct them, we were able to characterize simultaneously the refractive index and the thickness of an unknown medium that is placed between the lens and its focal region. This was done by clever manipulation of the beam angles with the same adaptive optics element in the focusing and in the imaging system. Finally, the medium-induced spherical aberrations were corrected based on the characterization results. The point spread function degradation of a focused laser beam was completely removed, which might be useful in optical tweezers or in laser processing of biological samples. While imaging through the planar refractive index mismatch, the bending of the object field was corrected and the diffraction limited performance restored.