With some 401K administrators, you can initiate a loan online. If that's not possible with your plan, you will need to call the administrator to initiate the process.
Keep in mind that you can typically borrow up to 50% of the vested balance. Additionally, if employment is terminated, either voluntarily or involuntarily, you will need to pay back the loan balance in full, or it will be considered a distribution, and will be subject to taxes, as well as a 10% early distribution penalty if you are under 59 1/2.
Bryan said it well.
Let me add that I am glad to see you borrowing rather than taking a hardship withdrawal, though you may not have qualified for that.
Be aware that you pay interest on your 401k loan. Now, the interest gets paid back into your account so you are actually paying yourself the interest but it tends to be close to the prime rate which is hopefully a much lower rate than what you are earning in your account.
So, borrowing sets back the growth of your retirement assets, which is why it should be avoided if at all possible Pay it back as fast as you can and try to set up a rainy day fund outside your retirement plan so you don't have to ding your retirement growth. Otherwise, you'll have less than you figured at retirement.
I would like to add that this should be your last resort. Borrowing against your future is never a prudent path.