I know $\sigma(m)=24$ for $m\in\{14,15,23\}$ but how can we find these numbers?
Here is what I did:
Let the prime factorization of $m$ be $$m=p_1 ^{\alpha _{1}}p_2 ^{\alpha _{2}}\cdot\cdot\cdot p_k ^{\alpha _{k}}.$$
Now $24=2\cdot2\cdot2\cdot3,$ thus $k\leq4.$
Case 1: $k=1$ $$m=p_1 ^{\alpha _{1}}$$ Taking $\alpha _{1}=1$ gives $p_1 =23 \implies m=23.$
But what happens if $\alpha _{1}=2,3,4,...$? Is there a bound for $\alpha _{1}$? What about the other cases $k=\{2,3,4\}?$
If your entire goal is to find those numbers $n$ satisfying $\sigma_1(n) = 24$, then it is easiest to just look at all the numbers up to $23$ one by one.
You can throw out $1$ and all the primes before $23$, leaving only $4,6,8,9,10,12,14,15,16,18,20,21,22$ (and $23$, which clearly has divisor sum $24$).
With regard to your method, you might notice that you've actually shown that the number of primes occurring with full multiplicity is at most $4$. In principle, this might be helpful. But in practice, every number up to $24$ has prime multiplicity at most $4$, so this bit of naivete isn't helpful. If you assume two primes, then you have one of the cases $p_1^3p_2$ or $p_1^2p_2^2$. The process of checking whether you can choose primes such that the corresponding divisor sums becomes $24$ starts to look more and more knapsackish, and therefore scary.