Reliability: consistent, but maybe wrong
A test is reliable if it gives the same score every time you measure the same person under the same conditions. A bathroom scale that always reads 2 pounds heavy is reliable. A ruler marked in millimeters is reliable. But they are not valid if they do not measure what they claim.
In education, a spelling test administered in a noisy hallway gives jumbled, inconsistent scores (unreliable). The same test in a quiet room gives consistent scores. The room change fixed reliability. But the spelling test is also invalid as a measure of reading comprehension, no matter the conditions. You are measuring the right thing reliably, but the test itself is the wrong tool for the question.
Validity and construct alignment
A valid test measures what it claims to measure. A test with questions about photosynthesis is valid for photosynthesis knowledge, but not for science reasoning ability. A math word problem is valid for word problem solving, but might also require strong reading skills, so it conflates math and literacy.
Construct validity is the deepest: does the test actually measure the theoretical construct you care about? A test of 'critical thinking' might measure test-taking skill instead. Proving validity is harder than proving reliability, which is why many tests are reliable without being valid.