Good news is that vege growth should be slowing down or stopping soon. (stem elongation and new leaf growth)
So, having an idea about how much more growth remains will help the next step...
Snap the stem about 6" below what you want maximum height to be. It may need support the first 24 hours, but will quickly heal. The top portion will curl back upward -- which is why ou want to snap it about 6" below max height.
remaining vege growth impacts where you want to snap it too... if vege growth is continuing, snap a bit lower than currently necessary, so you don't have to do this twice.
Weaken stem before snapping. It will damage vascular tissue, but should not sever it. IF the stems are too rigid to snap down without completely severing, this may not work for you. Rolling the stem between thumb and finger and weaken it and help bend it up without breaking it off. A little droop the first 24h isn't necessarily bad, but if you do it right, you can avoid the droop, too.
This is stressful, so in future adjust how you do things to avoid this context. People usually flip to flower later than necessary, which results in an over-grown plant. If it is an autoflower and does this, you may need a trellis or soemthing to reduce vertical height with early low stress training.