A "goofball" is someone who does dumb, silly things. For example, if your friend stands up and dances in a restaurant where no one else is dancing, you can call him "a goofball".
The word "goofball" is a little bit of an insult, but it also sounds sweet and affectionate. It sounds like you think the person is silly and embarrassing, but like them anyway. You're secretly happy that they're acting silly.