[subject] + [verb] + 得了 / 不了
[subject] + [verb] + 不了 + [object]
不了 after a verb says the action can't happen, and 得了 that it can. 了 in this pattern is read liǎo, the old verb "finish, manage", not le.
The first meaning is "can't manage it": something gets in the way.
The second, with verbs of using something up – eating, drinking, spending – is "can't finish it all".
不能 also covers rules and permission; V不了 is only about whether something is possible. 我不能去 can mean you aren't allowed. 我去不了 says circumstances stop you.
With 错, 忘 and 少, 不了 is a confident prediction: 错不了 "can't be wrong", 忘不了 "will never forget", 少不了 "can't do without".
不 goes between the verb and 了, never in front of the verb. An object follows 不了 or moves to the front as the topic.
The positive 得了 turns up mostly in questions and in the answers to them; a plain statement usually takes 能.