For Costa Rica and many other countries, it is wise to inform yourself about the need for vaccinations and to take those that are recommended. Here is something to consider: don’t wait until the last week before you get them. It may save you from having to postpone your trip at the last moment.

As I argued in another post, start early with finding out what is needed in terms of vaccinations. Visit your local vaccination service long (but not too long, I will get back to that below) – in advance, if only to find out which vaccinations are recommended for the countries that you’ll be traveling to. I can mention three reasons for this.
Reason 1 : In order to work, some vaccinations need to be taken some time in advance
First, some vaccinations should be taken with some time in advance before they work. Some need a repeat before you are ‘safe’. For sure, this is not true for all vaccinations. For example one starts taking malaria pills on the day of departure.
Reason 2 : Vaccinations take energy whereas you may be short of that
Second, vaccinations do keep your immune system busy for a while and this takes energy. The week(s) before your departure, you may not have a lot of energy left because of all the last-minute stuff that you end up doing and the stress that might come with it. Hence, your immune system would be down. You may not have enough energy left, and you may get sick, not as a direct side effect of the vaccination, but because your immune system is overloaded and under-nourished.
Reason 3 : Vaccinations may make you sick
The third reason is that vaccinations may have side effects, or even severe side effects. You don’t want to have to deal with those in the week or weeks before departure, or worse, to have to postpone your trip because you are sick.
Vaccinations may outlast your trip, so you do not have to loose a lot by taking them some months in advance. If you then get health problems you have time to deal with them.
Not too long in advance
Why should you not inform yourself too long in advance? As I argued in that other post, things may change from the time that you inform yourself and your day of departure. For example, in spite of a country being cholera free for years, an outbreak may have occurred in the meantime.
So, I would guess about four months in advance is a good period. At least, it worked for me. You could also do a second check shorter before you leave. You may have to go back to the vaccination service anyways for a vaccination that you have to take shortly before departure.
Disclaimer
PLEASE NOTE: this is a voluntary advice based on my experience. Make up your own mind about it and check with your own medical services.