If you wish to distinguish two states $|\psi\rangle$ and $|\phi\rangle$, you can only guarantee to do this if $\langle\psi|\phi\rangle=0$. You do this by measuring in a basis defined by the two states (alternatively, you apply a unitary $U$ such that
$$
U|\psi\rangle=|0\rangle,\qquad U|\phi\rangle=|1\rangle,
$$
and then measure in the standard $Z$ basis.
However, provided $|\langle\psi|\phi\rangle|\neq 1$, you can distinguish the states with some non-zero probability. There are a couple of different strategies that you can follow depending on how you want to interpret the result.
For example, to succeed with maximum probability, construct the operator $|\psi\rangle\langle\psi|-|\phi\rangle\langle\phi|$, and construct two projectors $P_+$ and $P_-$ which project onto the positive and negative eigenspaces of that operator. When you measure using the projectors $P_{\pm}$, if you get the + answer, assume you had $|\psi\rangle$, while if you get the - answer, assume you had $|\phi\rangle$. This is known as the Helstrom measurement, and you can show it has the maximum success probability.
Alternatively, if you don't want there to be any ambiguity in the result (thinking it was $|\psi\rangle$ when it was actually $|\phi\rangle$, you can use a POVM. Define
$$
E_1=p|\psi^\perp\rangle\langle\psi^\perp|,\qquad E_2=p|\phi^\perp\rangle\langle\phi^\perp|,\qquad E_3=1-E_1-E2.
$$
The states $|\psi^\perp\rangle$ and $|\phi^\perp\rangle$ are orthogonal to $|\psi\rangle$ and $|\phi\rangle$ respectively. You must choose the parameter $p$ to be as large as possible, but such that $E_3$ has no negative eigenvalues. When you measure with these, if you get answer $E_1$, you definitely did not have $|\psi\rangle$, hence you definitely had $|\phi\rangle$. Similarly, if you got answer 2, you definitely had $|\psi\rangle$. However, if you get answer 3, this corresponds to a "not sure" answer.
In the case of orthogonal states, such as your example, all these strategies are equivalent and have a probability of success of 1. You can describe the strategy either as "measure in the $X$ basis" or "apply Hadamard and measure in the standard ($Z$) basis".
SWAP
test, or if you are given only one single qubit and you need to determine whether the qubit is in $|+\rangle$ or $|-\rangle$... As @MariiaMykhailova mentions can you clarify? $\endgroup$