You may want to select your line using a different criterion, here I opt for the nearest.
To get the shortest distance between points and the (nearest) line feature, you can use the field calculator with this expression:
distance(
$geometry, -- the current point geometry
overlay_nearest(
'border', -- the name of your line layer
$geometry
)[0] -- get the first feature from the array of nearest features
)
To get the distance to the nearest point on the boundary of a polygon:
distance(
$geometry,
boundary( -- get the boundary of the polygon as a line geometry
overlay_nearest(
'polygon',
$geometry
)[0] -- get the polygon nearest to the point
)
)
Note: lines and labels were created separately to visualise the result of the expressions
Get a specific feature using an attribute value:
distance(
$geometry,
boundary(
geometry(
get_feature(
'countries', -- layer name
'NAME', -- field name
'Zambia' -- attribute value
)
)
)
) / 1000 -- convert m to km