PCB - trace width [duplicate]

In general how do you decide what trace width to use?

I prepared a PCB layout with the trace width mainly 0.4064 mm and couple of them are 0.3048 mm. power ratings are 5V , 12V at max 0.4A. What would be the smallest trace width that would be fine with that ratings?

I am going to have a trace for a power unit. I will connect the outlet supply (220-240V), what trace width would you recommend for it?