I’m trying to build a submarine, but everything I build ends up filling with water when submerged. Is there a way to make contraptions “waterproof”, that is to say, some kind of tool or technique that allows you to build a hollow box or something similar, put it underwater, and the inside stays dry?

Not possible with the source engine I think.

Spacewolf is right, it is not possible.

There’s probably a water proofing addon on www.garrysmod.org… maybe anti-noclip will work?

See above. It’s not possible because water in source is static. And anti-noclip is in no way related to water.