Welcome to the forums @EmperorPigeon!
There are several ways to handle coin pickups in Godot and other game engines, but I generally use something like this:
Coin script:
Extends Area2D
func _ready():
connect("on_body_entered", self, "_on_body_entered")
func _on_body_entered(other):
if (other.has_method("add_coin")):
other.add_coin()
queue_free()
Player script:
Extends KinematicBody2D
var coins = 0
# Other code here...
func add_coin():
coins += 1