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":
I'm having trouble sleeping. = I'm having difficulty sleeping.
If someone "is in trouble" or "gets in trouble," it means they are in a bad situation:
The boy got in trouble for stealing a toy from the store. or ( he will be disciplined)
If sales don't start improving soon, our company will be in trouble. or ( the company will have difficulty surviving)
The word problem is countable, and the word trouble is usually uncountable. We can say "a problem," but not "a trouble."
There's a problem with my online bank account.
I'm having some trouble logging into my bank account.
The speaker talked about five major problems in society. (notfive troubles)