With an appropriate $YNN$ force,
the $\Lambda$ single-particle potential ($\Lambda$ potential) can be made strongly
repulsive at high density, and one can solve the hyperon puzzle of neutron stars.
We investigate the consistency of such a $\Lambda$ potential, evaluated recently
from $YN$ and $YNN$ forces based on chiral effective field theory,
with hypernuclear data and heavy-ion collision data.
It is found that model calculations with such a $\Lambda$ potential can reproduce
the data of the $\Lambda$ hypernuclear spectroscopy and the $\Lambda$ directed flow in
heavy-ion collisions. Also, we evaluate the $\Sigma$ potential, which can be
calculated by using the same hyperon forces as for the $\Lambda$ potential.
Specifically, we show that the low-energy constants characterizing
the strength of the $YNN$ force can be chosen to suppress the appearance of
the $\Lambda$'s in neutron stars while at the same time
the empirical value of the $\Sigma$ potential is reproduced.