Petra is an ancient archeological city, and some say the 8th wonder of the world. Wadi Musa is a city adjacent to Petra. There are a lot of hotels in the area and a few that have dormitory style accommodation which is the cheapest, other than camping.
Be aware Friday is the muslim day off. There are not so much people driving on Fridays, and around 12.00 the city is empty, so it might be quite difficult to hitchhike. But being a tourist town there will still be some cars and small lorries, especially tourists in rental cars.
From inside Wadi Musa you can try to hitchhike to the exit of the town, a roundabout in the northeast. From there you have to hitchhike to the Desert Highway; the main road of the country. From the Desert Highway is super easy to hitchhike to the north, the south, etc. It's better to use the Desert Highway than the King Highway because there is more traffic and it's easier.
In front of the roundabout where you have to hitchhike there is a police station. Don't be afraid about them because they are very friendly. One police man even stopped cars for us (march 2019).
Other useful info
As Wadi Musa (Petra village) is a tourist city created for tourism, you will find that local people (mostly bedouins) will try to make you pay for the ride. They know how to make the people pay for everything so take care, because they will try to convince you that it's impossible to hitchhike out from Wadi Musa (and it's not)
It is possible to enter Petra easily for free (although not advised because entry without a ticket is prohibited). Hitch to the first village called Umm Sayhoun in the direction towards Little Petra. Walk south-west from there and down into the valley and you will enter Petra.