sometimes could describes your abilities like I could cross the river, I could work for 10 hours, I could play cricket. also could is a past of can like something which u didn't performed u say i could not do it. could is also used for request... like could I accompany you. Could I spend a time with you?
Now can it expresses about ability but it is formal.... also express