Anne,
I will speak to your question with respect to borrowing against the 401(k). The rule of thumb is, only borrow against the 401k as a last resort option. Just as was mentioned above with the HELOC, I would use same philosophy with your 401k. The borrowing against a 401k could potentially come in handy for a fix-and-flip or BRRR type transactions as you can quickly return the funds to the 401k. Here are some important facts with respect to borrowing against the 401k:
1) It must be a 401k, once you rollover your funds to an IRA, you don't have that capability.
2) You can only borrow up to 50% not to exceed $50,000.
3) You must make at least quarterly payments, with an interest rate set usually at prime + 1%. Your 401k administrator will help you set this up and usually you have to make monthly payments.
4) If you default on your 401k loan, the entire balance is distributed to you, then you have to pay taxes and a 10% premature withdrawal penalty. In my research, default rates are pretty high amongst 401ks loans.
5) If you leave your employer and want to rollover your remaining balance to an IRA to be able to invest in real estate, known as a self-directed IRA, you have to either A) Payoff the loan first, or B) When you rollover funds, the loan balance will be immediately distributed to you, thus taxes and penalties, and you forfeit all that tax-advantaged money back in the account.
6) 401ks are generally covered under federal ERISA rules, which affords you additional creditor protections, from outside of the 401k judgments. In other words, if there was a judgement against you, very difficult to impossible for them to come after your 401k money.
7) Your 401k avoid probate when passing onto your heirs.
Everyone's circumstances are different, so maybe it makes sense for you to borrow against the 401k, but I just think it is important that folks are fully educated on all factors before making that decision.
Congratulations in advance purchasing your first rental property! As an investor myself, I can say, first transaction is always the most challenging and then each one gets easier.