Let's give geometric motivation to the definition of the pullback of a section. Suppose $f:X\to Y$ is a morphism of topological manifolds (resp., of smooth manifolds, complex manifolds, or classical algebraic $k$-varieties), where $X$ and $Y$ are regarded as locally ringed spaces with their natural sheaves of real-valued continuous (resp., real-valued smooth, complex-valued holomorphic, $k$-valued regular) functions. Let $U\subset Y$ be open. The pullback of a section $s\in\mathcal{O}_Y(U)$ is defined to be $f^*s=s\circ f|_{f^{-1}(U)}\in\mathcal{O}_X(f^{-1}(U))$. That is, $f^*s$ is the image of $s$ along the map $f^\sharp:\mathcal{O}_Y\to f_*\mathcal{O}_X$. In general:
Definition 1. Let $f:X\to Y$ be a morphism of ringed spaces, let $G$ be a sheaf of $\mathcal{O}_Y$-modules and let $U\subset Y$ be open. The pullback of a section $s\in G(U)$ is the image of $s$ along the unit $G\to f_*f^*G$ of $f^*\dashv f_*$.
In the particular case $G=\mathcal{O}_Y$, one can check that the unit equals $f^\sharp$, so that our general definition is compatible with the particular case above. On the other hand, naturality of the unit implies equivalence with red_trumpet's definition, i.e., the following diagram commutes
$$
\require{AMScd}
\begin{CD}
\mathcal{O}_Y@>>> G\\
@VVV@VVV\\
f_*\mathcal{O}_X=f_*f^*\mathcal{O}_Y@>>> f_*f^*G
\end{CD}
$$
where the left map is $f^\sharp:\mathcal{O}_Y\to f_*\mathcal{O}_X$.
Naturality of the unit also allows to prove the following: if $\varphi:G\to G'$ is a morphism of sheaves of $\mathcal{O}_Y$-modules and $s$ is a local section of $G$, then $f^*(\varphi (s))=(f^*\varphi)(f^*s)$. (Write the naturality square of the unit of $f^*\dashv f_*$ for the morphism $\varphi$ and apply Definition 1.)
Note that from red_trumpet's definition it is easy to show that pullingback sections is a contravariantly functorial operation: if $X\xrightarrow{f}Y\xrightarrow{g}Z$ are morphisms of ringed spaces, $H$ is a sheaf of $\mathcal{O}_Z$-modules and $t\in\mathcal{O}_Z(W)$, by using the isomorphism of functors $(g\circ f)^*\cong f^*\circ g^*$ one gets $(g\circ f)^*(t)=f^*(g^*(t))$.
For a very detailed description of the action of the unit $G\to f_*f^*G$ on sections, see Alex Kruckman's answer (it's the composite at the end of his answer). On the level of stalks, the morphism $G(U)\to f^*G(f^{-1}(U))$ is the unique map such that for all $x\in f^{-1}(U)$ the following diagram commutes:
$$
\require{AMScd}
\begin{CD}
G(U)@>>> f^*G(f^{-1}(U))\\
@VVV@VVV\\
G_{f(x)}@>>>(f^*G)_x\cong G_{f(x)}\otimes_{\mathcal{O}_{Y,f(x)}}\mathcal{O}_{X,x}
\end{CD}
$$
where the bottom map sends $s_{f(x)}$ to $s_{f(x)}\otimes 1\in G_{f(x)}\otimes_{\mathcal{O}_{Y,f(x)}}\mathcal{O}_{X,x}$. That is, $\operatorname{germ}_x^{f^*G}(f^*s)=s_{f(x)}\otimes 1$. To prove this, consider the map $\tilde{s}:\mathcal{O}_Y\to G$ coming from $s\in\Gamma(G,Y)$ and study the map induced by $f^*\tilde{s}$ on stalks at $x\in X$ (and use 0098).
Warning for the differential geometers (there is some terminological overload): given a smooth manifold $M$, denote $C^\infty_M$ to the sheaf of $\mathbb{R}$-algebras of smooth real-valued functions on $M$. Given a vector bundle $\pi:E\to M$, denote $\Sigma_E$ to the sheaf of $C^\infty_M$-modules of smooth sections of $\pi$. A smooth map of smooth manifolds $f:M\to N$ induces the pullback of covector fields $\varphi:\Sigma_{T^*N}\to f_*\Sigma_{T^*M}$ (that in turns induces the pullback of differential $k$-forms $\Omega_N^k\to f_*\Omega_M^k$), which is a morphism of $C_N^\infty$-modules. The map $\varphi$ should not be confused with the unit $\Sigma_{T^*N}\to f_*f^*\Sigma_{T^*N}$. Actually, $\varphi$ equals
$$
\Sigma_{T^*N}
\to f_*f^*\Sigma_{T^*N}
\to f_*\Sigma_{T^*M},
$$
where $f^*\Sigma_{T^*N}\to \Sigma_{T^*M}$ is the adjoint map to $\Sigma_{T^*N}\to f_*\Sigma_{T^*M}$.