Traveling for a festival is one of the best decisions you can make and one of the easiest to fumble logistically. Every country has one or two headline events, typically its new year celebration, national day, a major religious festival, or a famous cultural event, when the atmosphere is unforgettable: street processions, special food, decorated cities, and locals in a generous mood.
The trade-off is that everyone else has the same idea. For a country's biggest festival, book accommodation as soon as your dates are firm; two to three months ahead is a sensible minimum for major events, and for world-famous ones people book six months to a year out.
Also consider the shoulder strategy: arriving a couple of days before the festival lets you settle in, see the build-up and decorations, and avoid the worst arrival crush. Check the exact dates on official sources each year, since many festivals follow lunar calendars and shift.