I have a nMOS with Vg = 4V, Vd = 5V and Vb= 0V. How to determine Vs? How does this transistor work? If it's the same for pMOS how will we determine
the source voltage?
Vs will depend on what is attached to it. Is the source attached to a resistor? Is it attached to GND? Is it attached to a voltage source? Is it attached to a capacitor?
Additionally, depending on what it's connected to, the answer may depend on threshold Vgs, carrier mobility, gate capacitance, MOSFET dimensions, lambda, and body effect...
So, you will definitely need to provide more information to find the answers you seek.