Oh god, this thread is a bit... Here goes an actual answer to the question.
If we talk about airliners / cargo, they all are equipped with a GPS transponder as well as an INS navigation system. In the event of a crash, in theory, the transponder must have been sending signals about where the plane was, along information about its attitude (pitch, roll and yaw angle along with airspeed data). If the plane is controllable and there isn't a huge storm it must be able to land on the water (and yes that is something pilots do practice on the simulator) and stay afloat long enough to evacuate. Life vest are onboard for such situations, however if you crash-land thousands of miles away from the coast, rescue will take a bit long. Be sure if any ship is close it will be told to go to the calculated drift of the crash. Water moves a lot and fast, even if you know exactly were the plane is supposed to be, by the time you arrive, most likely you'll find nothing, that's why you calculate the potential drift and establish a search pattern.
Now realistically the above scenario assumes a controllable airplane, so the cause of the crash is most probably related to a complete engine failure or some strange circumstances. In this case, pilots would glide towards coast, drastically increasing chances of survival, as well as calling on the radio as they slowly fall. This has indeed happened in the past and for the most part people survive unless they can't help it but ditch in the middle of the Atlantic in a storm.
However most planes that crash in the ocean do not meet the "controllable" criteria, this may be because structural damage, hydraulics issues, pilot disorientation and or instruments failure (most common frozen pitots or in the case of both B737 Max software misbehaviour) and even jammed control surfaces by ice (planes have redundant deicing systems but things happened in the past, I remember ATR 72s suffered from this). In this case, crashing on water is like crashing against a mountain, just like when you are in the pool, putting your arm into water slowly, nothing will happen, hit the water and it will hurt you. Roughly explained, you don't give time to the water particles to "move" and they will behave more solid like. In the event of a plane crash, it's like crashing on concrete, usually nobody ever survives the impact and usually the plane get completely destroyed and broken up in a bunch of pieces. Once sunken, water drifts will scatter parts hover hundreds of miles, making it very difficult to find all the wreck. A plane that falls very very quickly from the sky may also find trouble sending all the transponder data.
Regard-less, here comes the part nobody mentioned (and can't understand why), planes are equipped with 2 so-called "black boxes". One of the boxes records all parameters, sensor readings and pilot inputs during the flight, while the other records all radio and cockpit conversation. Retrieving this boxes is the absolute priority on any crash as they help us understand WHY it crashed and allows authorities, pilots, engineers and airlines to make the appropriate changes, in fact, this is the reason why planes are so safe this days. Both black boxes are very very well protected, designed tho withstand humongous forces and of course able to survive hundreds of feet under the salty cold ocean water. They also have a transponder an a set of batteries, after the crash they start emitting a signal up until the battery runs out (which is typically several days), and are ironically painted bright orange to facilitate its location. Rescue and investigation teams will do their best to locate the signal and use it to retrieve the black box, this has worked fine enough but unfortunately it isn't 100% fail proof. The famous MH370 for instance has never been located, yet pieces of the plane have been brought ashore by the ocean, but still couldn't determine where the wreck occurred. Should we ever found the boxes, worry not, we will find out what happened but up until then... Nothing, it crashed, all presumed to be dead, end story.
About smaller aircraft flying over the ocean... Usually you are limited to where you can and cannot fly, this is based on meteorological conditions, range, pilot license, etc etc. Likes of Cessna 172 and similar shouldn't fly over the ocean far from the coast or out a know route. If they crash, finding them is far more complicated, usually they have a transponder, a flight plan and the pilot radio, that's about it. In the even of a crash the transponder can only do so much. But again, you probably shouldn't be 200km ashore in a 172, just saying...