The word problem is connected with the word “solution.” There is usually some specific way to resolve a problem. If there’s a problem with your computer, the computer repairman can fix it. If you have a problem in your relationship, you can talk to the other person to find a solution.
The word trouble is more connected with general difficulties. We often use the phrase “having trouble” to mean “having difficulty”:
If someone “is in trouble” or “gets in trouble,” it means they are in a bad situation:
The word problem is countable, and the word trouble is usually uncountable. We can say “a problem,” but not “a trouble.”