The word coast refers to a geographic area - it is the part of the land that is next to the ocean. You can also call it the coastline.
The word shore can be used for the part of the land next to an ocean, sea, lake, or river. For rivers, you can also call the land next to the water a bank or riverbank.
Northeastern coast of Brazil
The shore of a lake
Coast is usually used from the perspective coming from the land, whereas shore is usually used from the perspective coming from the water:
We drove for three hours until reaching the coast.
(you drove over the land area near the water)
The lighthouse helps boats reach the shore safely.
(the boats go over the water land)
The word beach describes an area next to the water that is covered with sand, where people go to swim, sunbathe, and have fun.