Random movement to screen extents

What is the best way to make something move until it hits the edges of the screen and then change direction until it hits another edge? I have a clip right now that moves randomly, but it will just arbitrarily move randomly instead of bouncing off the screen edges. I’ve seen tons of examples of what I have now, but I haven’t seen many with what I want. Thanks for any help you can give me.