To find a formula for the inverse of $y\=f\left(x\right)$ you switch the roles of $x$ and $y$ and then try to solve for $y$. For example, to find the inverse of the function $y\={x}^{3}$ you first switch $x$ and $y$: $x\={y}^{3}$. Then you solve for $y$: $\sqrt[3]{x}\=y$, or rewriting in standard form, $y\=\sqrt[3]{x}$.
Very often it is not possible to carry out the step of solving for $y$, as there may be more than one solution. This means that the original function is not invertible on its natural domain. In such cases, it is usually possible to restrict the domain of the original function to one on which the solve step can be carried to completion.
For example, suppose you want to find the inverse, if it exists, of the function $y\={x}^{2}$. Interchanging $x$ and $y$ and trying to solve for $y$ leads you to $y\=\pm \sqrt{x}$, so you can conclude that the original function, $y\={x}^{2}$ is not invertible on the entire real line. However, if you restrict the domain to non-negative numbers, so $y\={x}^{2}$ when $x\ge 0$, then the inverse will be $y\=\sqrt{x}$. Note we could also restrict the domain to be non-positive numbers, so the function is $y\={x}^{2}$ when $x\le 0$, in which case the inverse is $y\=-\sqrt{x}$. This illustrates that there is invariably some arbitrariness in the choice of restricted domain, and that there can be more than one—sometimes infinitely many—definitions of an "inverse" for a function which is not invertible on its natural domain.