For the puffer?Looks to be a peaceful community fish but idk in 40g, the general rule in fresh and I’d assume salt(dosent apply to tetras or schooling fish) is minimum 6-7x length 3x width
But yes that is a good rule of thumb as a starting point. Just remember there are active small fish and lazy big fish, hence why the rules can be broken.