They are very similar, almost interchangeable.
"Sort' I use for things that can be sorted, selected. E.g. These sorts of items. This sort of example, things that can be seen as a class, or as a set.
"Type" is used for similar classifications, sets, etc according to my dictionary.
I use 'type" for types of people, (their characteristics) such as an angry type of person, a neat type of person. You can also say, this type of thing (class or set/arrangements), Type 2 diabetes, Type 1 diabetes,
Sorry I don't know the exact answer. Examples help, idiom helps.