You should arrange your policy as soon as you make a deposit on your booking. Many deposits are non-refundable, so travel Insurance can cover loss of deposit in case of cancellation.
If you have pre-existing medical conditions or are unable to take out travel insurance and you have paid a deposit, you will be unable to get back your non-refundable deposit.
Check with your doctor and travel insurer.