First, try a naive / brute-force approach.
For example you could iterate through all numbers between 1 and the [hopefully relatively small] number supplied by the user, and check if it divides, evenly, this number.
BTW, you can use the modulo operator to assert the fact that a given integer is exactly divisible by another integer (or more precisely the result of the modulo operation should be a particular value).
Once you have this working you can think of the ways that some of the numbers in the iteration could be eliminated. This approach is not unusual in solving problems:
1) solve the problem in a naive fashion and
2) look for ways to cut/filter/prune and otherwise improve upon the naive approach.
If nothing else, the naive approach provides a good baseline, and, because it is also simpler, it can also be used to verify the output of more complicated approaches.
Once you have played enough with this solution, you may try a distinct approach. The idea would be to decompose the number into its prime factors. In the example, 50 would give (1, 2, 5, 5, 50), and then you'd need to enumerate all the combinations of these prime factors (excluding the trivial, 1 and 50). The prime factor decomposition should generally be straight forward (think of the way you learned it in earlier math classes), but the enumeration of all possible combination may cause you to pause a bit (this is however the type of algorithms that keep coming in a fashion or another in CS applications).