List: A list is an ordered collectionso use list when you want to identify list element based on Index Number.(List can contain Duplicates)EX: List accList = new List();
Set: A set is an unordered collection of primitives or sObjects that do not contain any duplicate elements.So, use set if you want to make sure that your collection should not contain Duplicates.EX: Set accSet = new Set()
Map: A map is a collection of key-value pairs where each unique key maps to a single value. Keys can be any primitive data type, while values can be a primitive, sObject, collection type or an Apex object.EX: Map accMap = new Map();
The key differences between List, Set, and Map in Salesforce are: