Please put your code in code blocks using by putting it between ``` in the future.
You don’t need a conditional to determine if the body was a player. You can use a mask for that. It’s more efficient.
If you were going to test for a player object, using a class_name and testing for it would be a cleaner approach.
It would also help to see your scene tree.
Based on what you’re asking, you need an Area3D as a child of your MeshInstance3D and a CollisionShape3D as a child of that. Put your player on the physics layer, say 4 and call that your player layer. Make sure nothing else is on that layer. Add a mask to the Area3D for physics layer 4, and turn off the defaults on 1 for mask and layer.
Then your code should look like:
@onready var mesh_instance_3d: MeshInstance3D = $MeshInstance3D
# Only a Player can trigger this code.
func _on_body_entered(body: Node3D) -> void:
mesh_instance_3d.hide()