We use can + infinitive (can do / can drive / can sing etc.) to talk about ability in the present (I know how to do it). We use the negative form can’t + infinitive to talk about lack of ability in the present (I don’t know how to do it).
I can play chess and checkers.
Sheila can’t speak a foreign language.
Can you ride a horse?
We use could + infinitive to express general ability in the past.
When my grandfather he could swim across the river and back in fifteen minutes. (but now he can’t)
Was/were able to
We use was / were able to + infinitive (meaning managed to) to express ability that we had in the past in a particular situation. It shows that someone did something, but with effort.
It was a very difficult problem, but they were able to solve it.
We use the negative form (couldn’t) to express lack of ability in the past, either general or in a particular situation.
My little sister couldn’t dress herself when she was two. (generally)
However hard she tried, Mary couldn’t start the car. (lack of ability in a particular situation)
Remember that we use could (NOT was / were able to) with the verbs see, hear, feel, smell, taste, understand, remember, guess, etc.
I could hear a strange noise coming from the attic.
She could smell something burning.
Bear in mind that can has only present and past forms tenses. We use be able to to form all other tenses (future simple, present perfect, etc.)
I’m sure they will be able to solve the problem.
Phillip has been able to ride a horse since he started taking lessons.