Outflows emanating from the environment of stellar or galactic objects are a widespread phenomenon in astrophysics. Their morphology ranges from nearly spherically symmetric winds to highly collimated jets. In some cases, e.g., in jets associated with young stellar objects, the bulk outflow speeds are nonrelativistic, while in others, e.g., in jets associated with active galactic nuclei or gamma-ray bursts, it can even be highly relativistic. The main driving mechanism of collimated outflows is likely related to magnetic fields. These fields are able to tap the rotational energy of the compact object or disk, accelerate, and collimate matter ejecta. To zeroth order these outflows can be described by the highly intractable theory of magnetohydrodynamics (MHD). Even in systems where the assumptions of zero resistivity (ideal MHD), steady state, axisymmetry, one fluid description, and polytropic equation of state are applicable, the problem remains difficult. In this case the problem reduces to only two equations, corresponding to the two components of the momentum equation along the flow and in the direction perpendicular to the magnetic field (transfield direction). The latter equation is the most difficult to solve, but also the most important. It answers the question on the degree of the collimation, but also crucially affects the solution of the first, the acceleration efficiency and the bulk velocity of the flow. The first and second parts of this chapter refer to nonrelativistic and relativistic flows, respectively. These Parts can be read independently. In each one, the governing equations are presented and discussed, focusing on the case of flows that are magnetically dominated near the central source. The general characteristics of the solutions in relation to the acceleration and collimation mechanisms are analyzed. As specific examples of exact solutions of the full system of the MHD equations that satisfy all the analyzed general characteristics, self-similar models are presented.