An observable that has a definite value is an eigenvalue of the operator. If $A$ is a hermitian matrix of which $|\psi\rangle$ is an eigenstate, we have
$$\tag{1}A|\psi,a\rangle=a|\psi,a\rangle$$
You asked about the wave function, not the state vector, though. We can still get all the information we need from the wave function $\psi(x)=\langle x|\psi\rangle$, but we need to find a differential operator that corresponds to $A$. To do this, Fourier transform to $a$ space from $x$ space and find the operator that fulfills (1).
Suppose however that $|\psi\rangle$ is not an eigenstate. Then there exists no $a$ such that
$$A|\psi\rangle=a|\psi\rangle$$
Instead, we have a probability distribution function
$$P(a)=|\langle a|\psi\rangle|^2$$
where $|a\rangle$ is an eigenstate. This tells us the probability of our particle having $a$ between $a$ and $a+da$. To get $\psi(a)=\langle a|\psi\rangle$ is the trick then. We insert a full set of position eigenstates:
$$\langle a|\psi\rangle=\int \langle a|x\rangle\langle x|\psi\rangle dx=\int \langle a|x\rangle\psi(x)dx$$
What is $\langle a|x\rangle$? We use the fact that $|x\rangle$ is Dirac normalizable:
$$\int\frac{da}{2\pi}e^{ia(x-y)}=\delta(x-y)=\langle x|y\rangle=\int \langle x|a\rangle\langle a|y\rangle da$$
By inspection, we see
$$\langle a|y\rangle=\frac{e^{-iay}}{\sqrt{2\pi}}$$
Thus
$$\psi(a)=\int \frac{dx}{\sqrt{2\pi}}e^{-iax}\psi(x)$$
Which is of course just the Fourier transform.