I’ve heard that we can pray 2 rakah salah for our needs and wishes such as getting a job, getting married, education, etc but I do not know with what intention these are done. If I offer 2 rakah salah with the intention of offering it for the sake of getting a job or anything else then is that sufficient or is there a specific formula?

Yes that’s sufficient. Any time of day pray two rak’as for the sake of Allah with the intention of having your need fulfilled. After finishing the prayer ask Allah to grant you that need/wish.