These are called distance-time-rate problems. The key is remembering this equation: rate x time = distance.
Let your rate downstream equal c+3, where c is your rate in calm water. Similarly, let your rate upstream equal c-3.
You know your total time is 6 hours, so set up the equation as follows knowing that distance ÷ rate = time:
[24÷(c+3) ] + [24÷(c-3) ] = 6 hours
Now just solve for c, the rate in calm water. Hope this helps