Q:

How does one obtain observables from a wave function?

I'm beginning to study the quantum chemistry (my background is computer science and computational mathematics) and I'm not sure if I understand well the basic concepts, like wave function and operators.
I've read questions
What is a wave function in simple language?
Use of Operators in Quantum Mechanics,
and I understood that the wave function describes all the observable quantities of a system, e.g. an electron.
But what should I do when I want to obtain some of these quantities? Let's say I want to obtain spin and momentum. If I use the linearity property of quantum operators, $\hat{O}$ being the operator, $o$ its eigenvalue and $\psi$ the wave function, like this
$$\hat{O}\psi = o\psi$$
does $o$ always equal the observable value? In other words, is it enough to use the above equation and express the $o$ variable to get an arbitrary observable value?

A:

$\hat{O}$ will have a set of eigenvectors $\phi_i$ and eigenvalues $o_i$.
You can expand your wave-function $\psi$ in terms of the basis set $\phi_i$, i.e. $\psi=\sum_i c_i\phi_i$.
If you make a single measurement then your wave-function $\psi$ will collapse to one of the eigenvectors $\phi_i$ with probability $|c_i|^2$ in which case your measurement is the corresponding eigenvalue $o_i$.
In many cases we are interested in the average rather than a single measurement, in which case you evaluate
$$ \langle\psi|\hat{O}|\psi\rangle = \sum_i |c_i|^2o_i $$

A:

Just think of the operators and states in terms of linear algebra.
Correspondence between q.m. and linear algebra:
The operators $\hat O$ correspond to the matrices, the wave function $\psi$ corresponds to the vectors, and the the so called expectation values $\langle \psi|\hat O |\psi\rangle$ of the matrix are the possible outcomes of the measurement. Here, what I mean by this:

The operators $\hat O$ describe the quantity, which we like to measure. E.g. if we are interested in the energy of a system, we use the Hamilton operator $\hat O = \hat H$, but if we like to measure the spin of a quantum system, we would use $\hat O = \hat S$.
The wave function represents the state of the quantum system. It is similar to a vector in linear algebra. Therefore, your statement

I understood that the wave function describes all the observable quantities of a system, e.g. an electron. 

is not true.

The expectation value are the possible outcomes of a measurement.  However, if  the quantum system is in an eigenstate $\psi_i$ of that particular operator, the calculation becomes very simple: the possible outcomes of an experiment are just the eigenvalues $o$ of the operator. However, in general a quantum system will not be in an eigenstate of the operator of interest. However, as in linear algebra, we can express any state as a superposition of different eigenstates. Then the calculation becomes rather simple. 

For example: Suppose we want to measure the spin of an electron with respect to the $z$-axis. As a matter of fact, the spin operator of an electron $\hat S_z$ has only two eigenstates, which we denote by $|+\rangle$ and $|-\rangle$. Suppose the electron is in the state $|\psi\rangle$ (which is equivalent to the wave function $\psi$).

Decompose the state $|\psi\rangle$ into the eigenstates of the spin operator $$ |\psi\rangle = c_+ |+\rangle + c_-|-\rangle$$ where the two coefficients are just the projections $c_+ = \langle +|\psi\rangle$ and $c_- = \langle -|\psi\rangle$.
Now calc the expectation value: 
\begin{align}
\langle \psi|\hat S_z |\psi\rangle &= \big(c_+^* \langle +| + c_-^*\langle -| \big) \; \hat S_z  \; \big(c_+ |+\rangle + c_-|-\rangle \big)\\ 
 & = ... \\
 &= s_+|c_+|^2 + s_-|c_-|^2 
\end{align}
where $s_\pm$ are the two eigenvalues of $\hat S_z$.

A:

But what should I do when I want to obtain some of these quantities?

In general, the wavefunction encodes the probability amplitudes for a particular value of an observable to be measured.  Only in the special case that the wavefunction corresponds to an eigenstate of the observable can one 'obtain the quantity' $o$ by operating on the wavefunction with the observable $\hat O$.
That is to say, it is not generally the case that
$$\hat O \psi = o \psi$$
Generally, operating on a wavefunction with an observable yields a different wavefunction:
$$\psi' = \hat O \psi$$
where $\psi'$ is not a scaled version of $\psi$.  This means that the system is not in a state with a definite value for the observable $\hat O$, i.e., the state is a superposition of states with definite values for the observable $\hat O$.
For example, consider the superposition of two wavefunctions that correspond to eigenstates of $\hat O$:
$$\psi = \frac{1}{\sqrt{2}}(\psi_1 + \psi_2)$$
where
$$\hat O \psi_1 = o_1 \psi_1\,\quad\hat O \psi_2 = o_2 \psi_2,\quad o_1 \ne o_2 $$
Then
$$\hat O \psi = \frac{1}{\sqrt{2}}(o_1 \psi_1 + o_2 \psi_2) \ne o\psi$$
So, $\psi$ does not have a definite value for the observable $\hat O$ and, from this wavefunction, we can only calculate the probability of measuring $o_1$ or $o_2$.  For that, we use the fact that eigenstates of an observable are orthogonal to 'project out' the associated eigenstate.  Using abstract ket notation, the probability amplitude to measure the value $o_1$ is
$$\langle \psi_1|\psi\rangle = \frac{1}{\sqrt{2}}(\langle \psi_1|\psi_1\rangle + \langle \psi_1|\psi_2\rangle) = \frac{1}{\sqrt{2}}(1 + 0) = \frac{1}{\sqrt{2}}$$
The probability is the modulus squared of the probability amplitude and so the probability of measuring $o_1$ is $1/2$.

