I would start by talking to your HR department at work. The Summary Plan Description (which they should have) will state whether you can and how you do take loans from your 401(k).
With that said, loans from 401(k) plans should be very carefully considered before they are taken. Borrowing against your retirement is risky. Additionally, if you lose your job with your current employer or leave by your own choice the loan is payable in full or it becomes a taxable distribution which may also be subject to penalty.
You should make an appointment with your HR plan administrator. They will be able to walk you through the necessary steps to obtain a loan, if your plan allows. The process is usually pretty simple. Sign a form with the stated amount, an interest rate, and a payback period. It is sent to the plan custodian and a check arrives a few days later.
A 401k loan can make sense when you have to borrow money and you have no other options. So, your 401k should be a last resort. While a 401k loan has some benefits, I think it should generally be avoided except during a genuine financial emergency.
HI Romika! I have to agree with my fellow advisors, here. Ask yourself if it is truly a financial emergency. This could be something as dire as a job loss or medical need. If you "need" the money to make a purchase, then you may want to rethink your savings plan. Work toward building up cash reserves of 3 - 6 months worth of income, then work toward building your retirement. This will give you a cushion of funds so that you don't have to dip into your long term savings to fund a short term item.
Romika, just contact HR for requirements, if they allow it. But as others have pointed out, you should not be borrowing from a 401(k) unless it is a true dire emergency. A 401(k) is intended to save for your retirement. If you contribute to a 401(k) you should consider that money as not a liquid asset. Think of it as gone. When you reach retirement age, you may likely need it more than you think you need it now.