Ransomware and Trojans are very dangerous malware programs and they have different strategies!
Ransomware encrypts your data in order to then demand a ransom,
to regain access. The earliest variants of ransomware were developed in the late 1980s and payment should be made by mail. Today, ransomware authors require that payment be made by cryptocurrency or credit card, usually in Bitcoint!
The trojan is a spy that spies on your personal information and passwords
A Trojan tries to disrupt your data or your network, to steal data or to damage it in general. A trojan acts like a real application or file to trick you. After installation, a Trojan can carry out the action for which it was developed; all possible actions are possible by the Trojan, depending on the purpose and task!
There are two different types of software programs and they have different goals!