Advice to get 2.5yr old to fall asleep by himself?

My son is 2.5 yrs old. I have to lay down with him every night until he falls asleep, usually around 20-30mins. I don't really mind it but I'm pregnant again and I don't think it's going to be always possible to do that with a newborn. Any advice?