This was not a children’s book; more of a youth read. I read it in the late 1950’s or early 60’s. It involves two boys sailing, or learning to sail. One chapter was titled Never Swim From a D___ B___. The boys learn through experience that it is a very bad idea to swim from a drifting boat.
I’m irresistibly reminded of “Bevis” by the Victorian writer Richard Jefferies. It was published in 1882, though, and I don’t get the sense from your post that your book was that old…
The main characters are Bevis and Mark, and they build the boat themselves and learn to sail it by trial and error.