The wording used in your textbook was sloppy.
$A$ acts as $A^*$ on a bra, as $\langle u\rvert A\lvert v\rangle:=\langle u\lvert Av\rangle~$ is the same as $\langle u\rvert A\lvert v\rangle=\langle A^*u\lvert v\rangle~$, by definition of the adjoint. The latter formula also shows that $\langle A^*u\rvert=\langle u\rvert A$.
Everything becomes very simple in linear algebra terms when interpreting a ket as a colum vector, the corresponding bra as the conjugate transposed row vector, an operator as a square matrix, and the adjoint as the conjugate transpose. This is indeed the special case when the Hilbert space is $C^n$.
A common mistake when students begin the study of the quantum harmonic oscillator is to try to convert everything to integrals. The thing is, in most curricula, the QHO is also used as a way to secretly acquaint you with bra-ket notation, and all the conveniences it offers. In reality, you shouldn't need any integrals at all here.
$\lvert n \rangle$ is a vector in an abstract vector space. If you want to express it in terms of the position basis, you can do that: $\psi_n(x) \equiv \langle x \vert n \rangle$. However, this is not always what you want to do. What you really want is inner products between the bra-version of your vector, $\langle n \rvert$, and the ket version, $\lvert n \rangle$, perhaps weighted by applying an operator in there. That is, you are seeking things like $\langle n \vert \hat{\Omega} \vert n \rangle$, where $\hat{\Omega}$ is a stand-in for some operator, like $\hat{X}$ or $\hat{P}$. We could evaluate this in the position-basis (just as any inner product can be evaluated by putting row and column vectors into the same basis and doing a dot product):
\begin{align}
\langle n \vert \hat{\Omega} \vert n \rangle & = \int \lvert x \rangle \langle x \rvert \langle n \vert \hat{\Omega} \vert n \rangle \\
& = \int \langle n \vert x \rangle \langle x \vert \hat{\Omega} n \rangle \\
& = \int \langle x \vert n \rangle^* \langle x \vert \hat{\Omega} n \rangle \\
& = \int \psi_n(x)^* \Omega[\psi_n](x) \ \mathrm{d}x,
\end{align}
where $\Omega$ is the functional corresponding to the operator $\hat{\Omega}$, e.g. $X[f](x) = x f(x)$ and $P[f](x) = -\mathrm{i} \hbar f'(x)$.
But you don't want to do that.
The trick with the QHO is that there are two very convenient operators we define: $\hat{a}$ and $\hat{a}^\dagger$, and they have properties such as $\hat{a} \lvert n \rangle = \sqrt{n} \ \lvert n-1 \rangle$ and $\hat{a}^\dagger \lvert n \rangle = \sqrt{n+1} \ \lvert n+1 \rangle$.
You can write $\hat{X}$ and $\hat{P}$ in terms of $\hat{a}$ and $\hat{a}^\dagger$. Then use the properties of linearity (of inner products/integrals) and orthogonality and normalization (of your states $\lvert n \rangle$). As an example, suppose you want to compute $\langle n \vert \hat{a}^2 + \hat{a}^\dagger \vert m \rangle$. You have
\begin{align}
\langle n \vert \hat{a}^2 + \hat{a}^\dagger \vert m \rangle & = \langle n \vert \hat{a}^2 \vert m \rangle + \langle n \vert \hat{a}^\dagger \vert m \rangle \\
& = \sqrt{m} \ \langle n \vert \hat{a} \vert (m-1) \rangle + \sqrt{m+1} \ \langle n \vert (m+1) \rangle \\
& = \sqrt{m(m-1)} \ \langle n \vert (m-2) \rangle + \sqrt{m+1} \ \langle n \vert (m+1) \rangle \\
& = \sqrt{m(m-1)} \ \delta_{n,m-2} + \sqrt{m+1} \ \delta_{n,m+1}.
\end{align}
As you can see, plugging in particular values of $n$ and $m$ will make some (or all) of the terms vanish, leaving simple answers.
What you have to do is figure out $\hat{X}$ and $\hat{P}$ in terms of $\hat{a}$ and $\hat{a}^\dagger$ (the expressions are pretty simple). Then when asked for an expectation of, say $\hat{X}$ with respect to $\lvert 1 \rangle$, you simply compute
$$ \langle \hat{X} \rangle_{\lvert 1 \rangle} \equiv \langle 1 \vert \hat{X} \vert 1 \rangle = \langle 1 \vert \text{stuff with annihilation/creation operators} \vert 1 \rangle. $$
For $\hat{T}$ and $\hat{V}$, just use the classical expressions for kinetic and potential energy in terms of $x$ and $p$, and change $x \to \hat{X}$, $p \to \hat{P}$. For $\hat{H}$, I ask in return: Classically what is $H$ in terms of $T$ and $V$?
Best Answer
If your desired basis is the set ${|n\rangle}$, then the completeness relation tells you: $\hat{O} = \sum_a \sum_b \langle a|\hat{O}|b \rangle |a \rangle \langle b|$. Ideally, we prefer to do this in the orthonormal basis in which the operator $\hat{O}$ is diagonal, in which case this becomes $\hat{O} = \sum_a \langle a|\hat{O}|a \rangle |a \rangle \langle a|$. Then the coefficients of the expansion are just the eigenvalues of the operator and the basis is the set of eigenvectors. This is called the spectral decomposition.
This question is a bit vague. More details would be helpful.