There are sooo many things I've done to make final fights tougher. I can't give you specific advice since every group is different. I will note that since you have a larger group, you need to throw a lot.
I'll break this up into categories.
Environment: In a situation like this, the environment itself should be quite hostile to the PCs. Steal liberally from lair actions but don't necessarily limit yourself to the limitations of the book. Want multiple lair actions per round? Go for it. Lava pits, waterfalls of unholy water, pits of despair, go nuts.
Creatures: Don't make this a fair fight against just one BBEG. The big bad has mooks that stand in between him and adventurers. Since this is a god, a Balor or two could easily count as mooks.
Reinforcements for the final boss fight can also be handy, fighting waves (instead of just 1 wave) of creatures often increases the threat level significantly.
Plot Twist: Ok, this one is a bit tricky because you don't want the final fight to be easy and you don't want it to feel like a "the DM has to save us" but it can be a fun twist. I will sometimes set up someone that the group can bring over to the light, or that has had doubts about what the BBEG is up to.
This can also provide a nice break from the battle slog and give you a RP break in the middle of battle.
BBEG: There are guidelines in the DMG for building custom monsters, I would suggest using those. I normally start with something that feels appropriate and tweak.
If, for example I have a fight against Thrym (frost god) I may start with a Balor, substitute cold for fire and then add in other flavor. I'd look at the guidelines in the DMG and up HP, AC and damage appropriately.
I'd take a look at legendary actions for other high level monsters for inspiration and go from there.
Give him fun legendary and lair actions so he's not just a big bag o' hit points.
Another thing I do sometimes (which I stole from some blog somewhere) is to have the BBEG go through phases as they get hurt. So stat out full health to 2/3 health as normal. When he hits 2/3 health down to 1/3 health he gains different abilities and so on.
So going by my Thrym example, at first he's doing typical frost god things, swinging a big axe and doing an occasional frost breath.
As he gets down to 2/3 he starts to realize he's in danger. Maybe he starts radiating killing cold, or he starts making reckless attacks that leave him open but are more devastating. He can spin his axe over his head and send out deadly icicle missiles in all directions and so on.
At 1/3 HP he loses control and goes berserk. The environment around him becomes a death trap affecting friend and foe alike. His axe shatters but then forms a spinning cloud of death attacking everything that moves. He starts smashing the ground with his fist causing waves of damage that ripple out knocking people prone, possibly freezing them to the ground.
Use your imagination and switch up the monster and his tactics as fits your vision. Feel free to steal attacks from other monsters as you see fit.
When the BBEG dies, it may not mean the PCs are safe. Have the castle crumble, have vengeful spirits coming to get their revenge on the dead BBEG that aren't too picky about killing those in the immediate vicinity and so on.