If using maven:
To run all test cases, go into the project's root and run (if running from somewhere else, use the path)
mvn test
To run all tests from a single class:
mvn test -Dtest=<YourTestClass>
To run a test case from a test class:
mvn test -Dtest=<name-of-your-test-class>#<name-of-your-test-method> test
If you are not using maven (or Gradle):
see: How to launch JUnit 5 (Platform) from the command line (without Maven/Gradle)?
EDIT: Looks like the OP is unable to run these commands in his/her setup. Make sure you have correct dependencies and plugins (Junit and SureFire) in your pom. E.g. I created a demo maven project with this pom (only including the Junit and Surefire).
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
Here are the screenshots of working mvn test commands.

