Help I don’t know what to do

How many months ahead should I apply for an apartment?