Indeed, as has been pointed out in the comments, the reason these words look alike is because most of those languages are related, descended from a common ancestor. Languages change over time, and because different changes can happen in different areas or groups of speakers, dialects develop and can diverge sufficiently to split into new languages. We have clear historical evidence of this happening e.g. with the Romance languages (French, Spanish, Italian, &c.), which descended from Latin, but in the 18th and 19th century it was realised that most European as well as a number of Asian languages actually all share a common ancestor, which is now called Proto-Indo-European, and techniques were developed for reconstructing what it must have looked like—that was the birth of comparative linguistics.
To take the concrete example of seven, the reconstructed Proto-Indo-European form is *septḿ̥. The * indicates that the form is reconstructed and not attested (of course not: PIE was likely spoken in the late Neolithic, well before writing was developed), the little ring below the m means that it's a vocalic consonant (that is, a consonant functioning as a vowel), and the acute accent marks the location of the accent.
If we look at its reflexes in the daughter languages, the situation is very straightforward for some of the oldest ones. Latin, for example, doesn't tolerate vocalic consonants and inserts an epenthetic vowel, and the corresponding Latin word is septem (with the accent on the first syllable because it ended up ditching the PIE free accent for its own regular system). Greek's response to *m̥ between consonants or between a consonant and the word boundary is to turn it into a instead, and it also doesn't like s followed by a vowel at the start of a word, turning that into h; knowing that, we can see Ancient Greek ἑπτά (heptá) is a perfectly regular development (and one that preserves the PIE accent). Likewise in Sanskrit, the oldest attested Indo-Iranian language, which likes to change vowels to a and has सप्तन् • (saptán).
English and German are both Germanic languages, and the reconstructed most recent common ancestor of all of those, Proto-Germanic, has *seβun, which developed by dropping the *t from PIE *septḿ̥ (the exact way in which this happened is disputed), turning the *p into *β through Verner's law, adding an epenthetic *u before the vocalic *m to turn it into a regular *m, and finally changing that *m to *n by analogy with *newun 'nine'.
In Slavic languages the situation is a little more complicated because the ordinal *sedmъ replaced the cardinal *setь in Proto-Slavic, but again the steps required to get from from one form to the other can be formulated and enumerated (and doing this, if obviously in the other direction, is the job of the comparative linguist), and the point is that these steps don't just apply to this one word but to the entirety of the language. The same rules that turned *septḿ̥ into septem in Latin and ἑπτά in Greek turned e.g. *déḱm̥ 'ten' into decem in Latin and δέκα in Greek, and so on.
Anyway, those are the Indo-European languages. Arabic and Hebrew don't belong to that family, they're Semitic languages, which are part of the (as far as we can tell) unrelated Afro-Asiatic language family. The comparative method works there as well, and for Hebrew שִׁבְעָה (šiḇʿā) and Arabic سَبْعَة (sabʿa) and the other Semitic languages a
Proto-Semitic root *šabʕ- has been reconstructed, and you're not the first to note that that looks surprisingly similar to the Indo-European; the same goes for six, Proto-Semitic *šidṯ- / PIE *swéḱs. The same similarities actually seem to show up in other unrelated languages: Basque sei and zazpi, Etruscan śa and semφ, Hurrian šeše and šinti, Proto-Kartvellian *eks₁wi and *šwidi. Surface similarities across vast timespans don't prove much and the histories of some of these languages aren't very well understood, but this has still been enough that some people have suggested six and seven were ancient Wanderwörter, which isn't fundamentally implausible; a lot of languages don't really bother with numbers over five or so, but they're pretty handy when you're trading with people and you might as well borrow them while you're at it.