In 3rd (also 3.5) edition of DnD there has a confirmation roll in order to see if a critical threat was a critical or not.
The main advantage of this rule was that since the second roll had to be a hit (success) in order to confirm, the probability of each critical was affected by both the ability of the attacker (by his bonus to the d20) and the ability of the defender by (by his AC). So for example a 10th level fighter had a higher probability to critically hit an 1 level orc than a 2nd level fighter.
The disadvantage of this system was that it was more complicated and demanded more rolls (in case of a critical threat) for the same task.
5th edition introduces the system of advantages/disadvantage where you you roll 2 dice and keep the higher or the lower respectively.
I suggest a way of combining critical hits/failures in more general way (as critical rolls, not only for attacking) used for every action with the idea of advantages/disadvantages.
For every d20 roll you always roll 2 d20. You use 2 different colored dice and one of them is always treated as the main die.
Critical Hit or Failure is defined by whether the two dice had rolled the same number or not.
a) If they rolled the same number and the target DC was reached then we have a critical hit
b) If they rolled the same number and the target DC was not reached then we have a critical failure (fumble)
c) If they rolled different numbers then it is not a critical (success or failure)
Now regarding advantages/disadvantage you still keep the higher or the lower die respectively and also check if they had the same results to see if it is a critical.
If you do not have an advantages/disadvantage, you still roll 2 dice but you only use the result of the main die (the second die is only used for the critical purposes in order to see if the result is equal to the main die)
They aim of the above rule is to combine under a common framework of just rolling two dice (a main one and a second one) the following:
b) critical success for any check
c) fumble for any check
d) let the probability of critical be affected by how good the performer is at the task and how difficult the task is
Bob the fighter attacks with his (axe) with +3 to hit a Bear with AC 15
He rolls 2 dice (decides which die is the main one)
a) If he rolled the same result on both dice he checks whether the result was a hit or not. If it was a hit it was a critical hit, else it was a fumble.
b) If he rolled two different results he just uses the main die and ignores the other (no critical roll is possible here).
Mary the halfing rogue tries to disarm a trap with +5 bonus and a disadvantages
a) If she rolled the same result on both dice she checks whether the result was a success or not. If it was a success it was a critical success (ex: the DM might say that not only she desables the trap but also can take it with her), else it was a fumble (ex: the trap explodes and does maximum damage).
b) If she rolled two different results she just uses the lowest die because of the disadvantage (no critical roll is possible here).