Explanation:
we start with the smallest prime factor : 2
we divide the number and the following results by the smallest prime factor that did not fail the division yet. until we reach 1 as result.
so,
18 ÷ 2 = 9
9 ÷ 2 no
9 ÷ 3 = 3
3 ÷ 3 = 1 finished
the prime factors are
2×3×3