Because sand has small grains, you need to reduce the flow for the vacuum. it is really easy to suck the sand right out of a tank. Use smaller diameter tubes and hoses until you have finished vacuuming. For emptying bigger diemeter hoses are fine.
Different sands have different grain sizes. So finding which size works for your tank may take some trial and error.
I never vacuum into anything but a bucket. You can accidentally suck up small fish or plants etc. and retrieving them when they go out the window may not be so easy nor timely.
You can also reduce the flow rate in a siphon setup by have an inline flow control like a ball valve etc.