I'm aware this is a very simple question, I must be missing something obvious.
Given that the numbers coming out of two independent dice throws are different, find the probability that the sum of the numbers is 4.
Apparently the correct answer is 1/15. Though my answer is 1/18:
So you can roll either a $(1,3)$ or a $(3,1)$. So then I do $\left(\frac{1}{6}\cdot\frac{1}{6}\right)$ + $\left(\frac{1}{6}\cdot\frac{1}{6}\right)$ = $\frac{1}{18}$
One way to approach this problem is to count (as you did) the total number of rolls that could give you 4, and then divide by the total number of possible rolls where no two dice are the same.
As you mentioned the number of rolls that give you $4$ is $2$, i.e. $(3,1)$ and $(1,3)$.
However, I think why you're getting $\frac{1}{18}$ is because you then divide by all possible rolls that could occur which is $36$, so you get $\frac{2}{36}$. Instead, you have to divide by all allowable rolls, i.e. rolls that do not have two of the same number. There are $30$ such rolls. To see this you remove all the pairs $(1,1),(2,2),$ etc. from the $36$ total rolls.
This gives you the probability you're looking for:
$\frac{2}{30} = \frac{1}{15}$
In general, to think of such probability problems you count the amount of what you're looking for and divide by all allowable outcomes you choose from.