A Dictionary<TKey, TValue> maps keys to values with fast lookups: var stock = new Dictionary<string, int> { ["aspirin"] = 40 };. Reading stock["ibuprofen"] for a missing key throws KeyNotFoundException. Use TryGetValue(key, out var value) when the key might be missing, or GetValueOrDefault(key).
The indexer also writes: stock[key] = 10 adds the key or replaces its value. Add(key, value) throws if the key exists. Counting is a classic pattern: counts[item] = counts.GetValueOrDefault(item) + 1;.
Keys compare exactly by default, so "Aspirin" and "aspirin" are different keys. Pass StringComparer.OrdinalIgnoreCase to the constructor to ignore case. Do not rely on the order you get when you loop over a dictionary; sort the keys when order matters.
A case-insensitive dictionary, a safe lookup and an add-or-update.