The rules on "Area of Effect" state (emphasis mine):
[...] A spell's effect expands in straight lines from the point of origin. If no unblocked straight line extends from the point of origin to a location within the area of effect, that location isn't included in the spell's area. To block one of these imaginary lines, an obstruction must provide total cover.
So for most spells, if somebody is on the other side of a wall they cannot be target by an area of effect spell whose point of origin is on the directly opposite side of the wall. I'm unsure if this is the case with the earthquake spell in particular which states:
[...] For the duration, an intense tremor rips through the ground in a 100-foot-radius circle centered on that point [...]
[...] each creature on the ground in the area must make a Dexterity saving throw. [...]
[...] The tremor deals 50 bludgeoning damage to any structure in contact with the ground in the area [...]
This spell makes an area of effect centered on a point but is a bit unusual in that it can target structures as well as creatures.
There are also area of effect spells like fireball and darkness which explicitly state that they can go around corners, but the earthquake spell does not state this same thing. And so I'm left unsure:
Can earthquake affect something on the directly opposite side of a wall from its point of origin?