I'm confused by "costado" in the sentence "le habría costado concentrarse." I know it means "it would have been hard for him to concentrate," but I'm not sure how "costado" fits in there?
The verb costar when it isn’t “to cost” becomes “to be difficult” in some situations.
Regular costar doesn’t take any kind of object. An item “costs” however much it costs.
But when costar is used with indirect objects [me, te, le, les, nos, os] it takes on the meaning of “to become difficult (for someone)”, and it’s used the way you would use gustar, molestar, importar, encantar and other verbs like it.
Me cuesta hablar. = It’s hard for me to talk
Me cuesta mucho entender lo que dicen mis profesores. = It’s really hard for me to understand what my teachers/professors are saying. / It takes a lot of effort to understand what my teachers are saying.
Está intentando, pero le cuesta. = He/She’s trying, but it’s hard for them.
It sometimes just means “to cost someone (a lot/a little):
Me costó un ojo de la cara. = It cost me an arm and a leg.
[the Spanish version of this expression is “it cost me an eye from the face”]
The idea behind costar is that it “takes a lot” to do something, so it’s kind of an investment. You invest your time, energy, or concentration into something and when it “costs a lot” it’s “difficult”… I guess the idea is “how much does it take to do X? A lot? Then it’s difficult” or something.
It might be easier to imagine it like fatigue or a stamina bar, or something like HP or MP in a video game. Doing actions “cost” something. That’s the idea behind costar.
When costar is used like “to be difficult” it’s synonymous with me resulta difícil or lo encuentro difícil “I find it difficult”
If your question is why is it costado, it’s a matter of the perfect tenses and past participles. The costado exists because it came along with a conjugated form of haber which indicates a perfect tense.
In linguistic senses “perfect” means “completed actions”, so it’s what’s used to make something “more past”.
Rather than hago “I do” it’s he hecho “I have done”, which puts it just a little bit in the past… that vs. hice “I did” and había hecho “I had done” which is still more past than past.
The habría is conditional “would have”… talking about how something might have been, though the thing is already over.
And costado is the past participle of costar …in English “cost” and “cost” don’t change forms, but imagine encontrar “to find” vs. encontrado “found”, or ser “to be” vs. sido “been” and it’s like that.