Every time you think of something "right when it started" you can use the ready function
##code here will run once on load
To pseudo randomize something, you will need to call for the randomize function once on the beginning of the level scene or project, you can also use the ready function for that. This will make sure that any random number generator function you use will use a different random seed every time this is called.
Now to generate randomness... there are many many ways.... but I'll give it a shot. Since what you want is positions (vector2 x y), you will need 2 values and whose values will have to be inside the viewport/camera region
randf() ## will give you a float value from 0 to 0.999999999.... (as far as I know it is never 1 unless its rounded)
randi() % 20 ## will give you an integer between 1 and 19 if I'm not mistaken
and you can round values with "round()"
so assuming your game level is 100x100, on the ready function I'd call
onready var player = $pathtoplayernode
onready var enemy = $pathtoenemynode
player.global_position = vector2(randi() % 101, randi() % 101)
player.speed = randi() % max_speed
enemy.global_position = vector2(randi() % 101, randi() % 101)
enemy.speed = randi() % max_speed
Should get you started, assuming you already have code to move them