Bar is a city in Montenegro. The M2.4 road passes through the city and it is rather a small place, so it is not difficult to find a good place for thumbing.
Simply walk north along the M 2.4 and try to find a spot where cars can stop easily. Bar is not a big place, so it is not difficult to get out in the direction of Budva or Podgorica.
Just walk south along the main road until you pass the harbor and the train station. Just stand on the side of the road and thumb from a place where cars are able to stop. If you prefer a petrol station, you will find one after walking for several minutes. If heading to Albania try to catch a direct lift at least to the border, as Ulcinj is more to the south and this will make your route unnecessarily longer and more complicated.
Accommodation and Sleep
Because of the harbor, the shoreline is quite industrial. If you want to camp on the beach, it is better to leave the city for that.