Card game from Godot 3 to 4 not working

Godot Version

I´m new to godot and ive been following this tutorial By “Adventures in Godot”
and although I have renamed some old methods into the new ones but I still found more errors. Point being is, I don´t understand how to fix this error:

extends MarginContainer

@onready var CardDatabase = load("res://Cards/CardsDatabase.gd")
@onready var CardDatabaseTemp = CardDatabase.new
var Cardname = 'Mentor'
var CardInfo = CardDatabaseTemp.DATA[CardDatabaseTemp.get(Cardname)]
var CardImg = str("res://Assets/Cards/",CardInfo[0][0],"/",Cardname,".png")

Line 6 gives me an error that says “Invalid get index ‘DATA’ (on base: ‘Nil’).”
Why does this happen?

I think this should have a function call not just .new

CardDatabase.new()

Base nil means your variable wasn’t instantiated.