You should read Random Number Generation.
First you generate a random number between whatever values you want, and then you use that data to change the position of whatever you want.
Example, lets say you use randf() which returns you a random float between 0.0 and 1.0. You use it twice and then you multiply each number by the width and height of your screen. Finnaly you set the position to those numbers.