How to keep wires inside of a project box

I want to build a 3d-printed project case, but I'm wondering how to keep the power wire inside the case. I'll be creating an opening big enough to insert the power wire, but how do I keep it from coming out (like if someone pulls on it by accident). I have a lot of USB cables that have this big, round, grommet-like device on them. Is that something you can easily get and put around your wires yourself? What do people normally do for this?

Thanks!

You can tie a knot in the wire. You can use silicone adhesive to glue the cable into the hole. You can use a strain-relief bushing that clips into a hole in the case.

using wire securing clamps.

print them out like these for example and use screws to secure it in the project box

Or you can use a cable gland.

Or a cable tie.

Weedpharma