  The second Gaia data release (GDR2) provides precise five-parameter
astrometric data (positions, proper motions and parallaxes) for an
unprecedented amount of sources (more than $1.3$ billion, mostly stars). The
use of this wealth of astrometric data comes with a specific challenge: how
does one properly infer from these data the astrophysical parameters of
interest?
  The main - but not only - focus of this paper is the issue of the estimation
of distances from parallaxes, possibly combined with other information. We
start with a critical review of the methods traditionally used to obtain
distances from parallaxes and their shortcomings. Then we provide guidelines on
how to use parallaxes more efficiently to estimate distances by using Bayesian
methods. In particular also we show that negative parallaxes, or parallaxes
with relatively larger uncertainties still contain valuable information.
Finally, we provide examples that show more generally how to use astrometric
data for parameter estimation, including the combination of proper motions and
parallaxes and the handling of covariances in the uncertainties.
  The paper contains examples based on simulated Gaia data to illustrate the
problems and the solutions proposed. Furthermore, the developments and methods
proposed in the paper are linked to a set of tutorials included in the Gaia
archive documentation that provide practical examples and a good starting point
for the application of the recommendations to actual problems. In all cases the
source code for the analysis methods is provided. Our main recommendation is to
always treat the derivation of (astro-) physical parameters from astrometric
data, in particular when parallaxes are involved, as an inference problem which
should preferably be handled with a full Bayesian approach.

Instrumentation and Methods for Astrophysics