You can complete 1/6 of your task in an hour. Your friend can complete 1/6 as the same task in an hour how long will it take to complete a task if you work together?
If you and you friend both can complete 1/6 of a task alone, you have to add 1/6+1/6 to find how fast you can work together. That comes out as 2/6 or 1/3 if you reduce. so It will take 3 hours for you to complete a task because 1/3+1/3+1/3=1