Borrowing against 401K

If I need to borrow 30K against a 401K fund, what is the process and how long do I have to pay it back?