how do you make a auto move script?

I am struggling to make a script where without pressing a button the object moves from one side to the other. If anyone can help or give me any advice thank you

Hi,

there are many tutorials out there and would recommend you view some. Moving an object without interaction should be covered in very basic ones.
There are many ways to do this but if you want to try on your own you can try with MoveTowards (Unity - Scripting API: Vector3.MoveTowards) your point A - in update() and then Vector3.distance is very low - change the moveTowards target from A to B… or similar.
Questions need to be more specific to be answered.
Good luck,