I would like to know how to calculate the area of the vector layer (red in the photo) under each polygon (white square in the photo). The red layer has the area (km2) in its attributes. But what I want to know is how much (area) of the pink layer is within the square grid. Both my layers are in meters already.
The easiest may be to calculate each area in the red vector, then and join data to your polygon layer.
Fist use "Clip" tool to clip your red vector layer with your polygon layer. Then compute areas in a new field with "Field Calculator" and
$area expression. Finally use "Join attributes by location" to join your clipped layer data to polygons.
About "Join by location" settings, be careful with spatial criteria choice,
within should be ok. And if some of you polygons contains more than one feature you may have to use
sum value in Statistical summary parameter.