Dear student,
Coastal areas will generally have more moderate temperatures than in land areas because of the heat capacity of the ocean.The farther a region is from the ocean, the more extreme its climate is likely to be. A continental summer is hotter than a coastal summer, and a continental winter is colder than a coastal winter.
Coastal areas experience moderate climate as water takes more time to cool than heating due to the heat capacity of ocean and when it gets heated the air above it also gets heated while it relatively cools slowly thus it have moderate climate than inland areas
Regards