... and I suspect you can't detect both water and waterloged blocks in only one command. Or can you?
You can create a "block group" by specifying block ids into a .json file and then you can use the file as a selector. This feature is a part of "data packs" and can save you a lot of time in some projects.
/execute if block ~ ~ ~ #megacrafter10:waterlogged_blocks
"waterlogged_blocks" is the .json file with the ids and "#megacrafter10:" is a data pack namespace where the file is located. This allows you to test for multiple block types at once instead of writing multiple detection commands for each block type.
the command above will only detect the blocks but you can also add criteria so the command detects those blocks only if they are waterlogged:
/execute if block ~ ~ ~ #megacrafter10:waterlogged_blocks[waterlogged=true]
now the "waterlogged" criteria will apply to every block type inside the file and test if that block type is waterlogged.
I'm not sure if you can add water inside of the file because water doesn't have a "waterlogged" propertie so it might not work when you add the criteria. It's best to use a separate command for water detection.