To add on to what Malia said, the #1 performance killer is periodical loops. Try to avoid them as much as possible, and if you do need to use them, use a reasonable time, here's an example of one I saw the other day that hurt my soul
code_language.skript:
every tick:
loop all players:
loop 20 times:
add 1 to health of loop-player
Now, in this example, EVERY SINGLE TICK on the server, we are looping all players, then within that loop we are looping 20 times and adding to their health. What the person writing here didn't realize is all of this is attempting to happen in ONE TICK. Not to mention adding 1 to the player's health 20 times in one tick will have the same effect as just setting their health to max.
Even that being said, let's say you have 20 players on your server, EACH TICK on the server you are attempting to loop all 20 players, and run more code for each player.
Things like this will just eat up your performance, because during this same tick the server is trying to do hundreds of other tasks, but this one shitty script is trying to do hundreds of tasks as well.
If you were really needing to do something like this, space your periodical loops out. Do some math and try to estimate the damage its going to do to your server, and think realistically, does a players health need to update every tick? GOD NO... plus theres game rules for things like this.
Having a good understanding of programming as well as a good understanding of how MC works, can help you write scripts that actually perform very well on your server.