Solenoid/ Mosfets

So I’m creating a circuit using a (Mini Pushbutton Switch) that controls a (12V Solenoid Valve - 3/4’’) and my question is solely on the resistor values and the mosfet that’s being automatically added when I add them to my circuit.

  • How are these values determined? Where does the math behind them come from? If I do V=IR, while V is 12V and I is 50mA for the button, shouldn’t R = 240 ohms? It’s automatically making it 10 k Ohm.
  • Also how is the Gate resistance for the Mosfet being determined to be 10 k Ohms as well?

Thx

I found this video by addohms might help you: https://www.youtube.com/watch?v=GrvvkYTW_0k

He also provides a great PDF workskeet here: http://addohms.com/mosfet-guide