  The notion of extriangulated category was introduced by Nakaoka and Palu
giving a simultaneous generalization of exact categories and triangulated
categories. Our first aim is to provide an extension to extriangulated
categories of Auslander's formula: for some extriangulated category
$\mathcal{C}$, there exists a localization sequence
$\operatorname{\mathsf{def}}\mathcal{C}\to\operatorname{\mathsf{mod}}\mathcal{C}\to\operatorname{\mathsf{lex}}\mathcal{C}$,
where $\operatorname{\mathsf{lex}}\mathcal{C}$ denotes the full subcategory of
finitely presented left exact functors and
$\operatorname{\mathsf{def}}\mathcal{C}$ the full subcategory of Auslander's
defects. Moreover we provide a connection between the above localization
sequence and the Gabriel-Quillen embedding theorem. As an application, we show
that the general heart construction of a cotorsion pair
$(\mathcal{U},\mathcal{V})$ in a triangulated category, which was provided by
Abe and Nakaoka, is same as the construction of a localization sequence
$\operatorname{\mathsf{def}}\mathcal{U}\to\operatorname{\mathsf{mod}}\mathcal{U}\to\operatorname{\mathsf{lex}}\mathcal{U}$.
