How can i use the same function in different scripts?

Godot Version

4.2.2.stable

Question

How can i use the same function without having to copypaste it everytime i put it in a script or change something about it

You could use static functions:

where do i create a static function and how do i call it in a script?

Create a utility script, e.g. utilities.gd and give it a class_name:

class_name Utilities

Then, add your shared functions to it, e.g.

static func shared_function(example_arg: float) -> void:
    print(example_arg)

From the other scripts, you can call the shared_function:

Utilities.shared_function(3.1459)

There are some alternative approaches too, it really depends on your project. Give that a go.