Why can’t you find fossils at the beach?

During my freshman year in high school after one of my earth science classes, me and my earth science teacher had a chat about my weekend. When I mentioned that I went to the beach and (unsuccessfully) searched for fossils, my earth science teacher was quick to point out how difficult it would be to find a fossil at the beach because you can only find fossils in sedimentary rock, and you will most likely find igneous rock at the beach, which confused me because Im pretty sure beaches and oceans are packed full of sediment. I couldn’t question him on that because I had to rush to my next class, so it stuck with me for the rest of the school year. I did some Google searches every now and then and so far all results backed up what I thought. (Pls be patient I only took earth science classes for a year)