You can use a system of equations
let x be shirts and y be sweaters.
Maggie bought
2x + 2y = 86
Mia bought
3x + y = 81
Multiply Mia's purchase by -2 and add that to Maggie's purchase to eliminate y
-6x - 2y = -162
2x + 2y = 86
-4x = -76
Divide both sides by -4
x = 19
Substitute 19 for x in Maggie's purchase to find y
2(19) + 2y = 86
38 + 2y = 86
Subtract 38 for both sides
2y = 48
Divide both sides by 2
y = 24
Check both x and y in Mia's original purchase
3x + y = 81
3(19) + 24 = 81
57 + 24 = 81
Shirts cost $19 each
Sweaters cost $24 each
I hope this helps please send me a message if you have any questions.