There some physical constraints you must consider, however if your only question is about wattage I suggest replacing your 300 watter with the largest QUALITY PSU you can afford. It's the cheapest insurance policy you'll ever buy for your rig.
I would advice against getting as big as possible a PSU, since that wastes money and power. Quality is what you really want.
Anyway, if the 400watt has no shortcommings compared to the 350 watt (number of connectors, amount of power on each voltage, quality). and is in no way larger or smaller than the 350w. Then yes, you can replace the 350w.
But you should probably tell us what system it is supposed to run, and which powersupply model you have and which one you are planning to use.
I'm assuming it,s the psu, from what i have researched. the poewr light comes on for a few seconds, and i can hear the motherboard whistling, then it shuts down.
Ok. So you have a problem and need to solve it. Why didn't you start off with that as your question? the PSU is a good place to start but that doesn't mean it will fix it. Have you tried another PSU or powered up the PSU while it is not connected.