First, see Choosing a subset optimization target.
Then, follow instructions for to start subsetting to your pipeline:
Subsetting with test runner integrations
Supports nose and pytest
Subsetting with the Launchable CLI
Supports Android Debug Bridge, Ant, Bazel, Behave, CTest, cucumber, Cypress, GoogleTest, Go Test, Gradle, Jest, Maven, minitest, pytest, Robot, Rspec, and other/custom test runners