Let the cost of a shirt be x, and let the cost of a sweater be y.
The cost of 5 shirts will be 5x and the cost of 4 sweaters will be 4y.
Since it is given that 5 shirts and 4 sweaters cost $267, it follows that:

This gives the first equation.
The cost of 3 shirts will be 3x and the cost of 5 sweaters will be 5y.
Since it is given that 3 shirts and 5 sweaters cost $259, it also follows that:

This forms the second equation.
Next, solve equations simultaneously:

Substitute the x value, x=23 into the first equation to get the value of y.

Hence, the cost of a shirt is $23 and the cost of a sweater is $38.