This has been studied pretty well academically. The most common study instrument is a survey of the opinions of AI researchers. The other mechanism is subjective assessment by business analysts about which sectors are most likely to be automated, using two criteria: ease of automation, and potential profit from automation (based on the size of the workforce). I have a fairly detailed discussion of some sources below.
The upshot is: any job that requires little training is probably a bad idea. Additionally, any job that requires directly caring for or educating another person, or involves the production of a fine-arts product is probably a good idea. In between, jobs like sales or administrative assistants are likely to become more "winner takes all": low-level sales jobs are likely to disappear, but high level ones that involve a lot of human contact, strong social skills, negotiation, and persuasion are likely to stay. In general, jobs that are plentiful, routine, and high salary are likely to be fully or partially automated first.
This was discussed informally at AAAI a few years ago (2015?). One researcher's daughter was considering different career paths. The conclusion that was reached (half-jokingly) was that AI-researcher was the best bet. Everything else we could name, someone was working on automating.
More concretely, there are a number of recent papers and reports. A good starting place is the 2017 PWC report. Section 4.2 covers the different sectors at risk, and 4.3 provides a rationale based on what employees typically do in each sector. The report suggests that men without a high school diploma will be most readily affected, with about 3-4 times the rate of automation as compared to college graduates. The specific sectors at greatest risk are wholesale & retail trade (essentially: sales people), manufacturing, administrative support, transportation & storage, public administration and defense, financial & insurance, water, sewage & waste management, and electricity and gas supply. All these sectors were estimated at being 30% or more automatable. The safest areas were education, and domestic assistants (e.g. live-in caretakers).
The PWC report is also mostly in line with the 2013 paper by Frey & Osborne. This paper proposed a 9 factor model (summarized in Table III), and then evaluated hundreds of occupations by their probability of automation. Jobs requiring a fine-arts component were very unlikely to be automated. Additionally, jobs that did not take place within cramped spaces were unlikely to be automated. Having a large component of caring for others, persuading others, negotiating with others, or social perception, reduced the risk of automation. Originality requirements also quickly reduced risk. Requirements for manual dexterity did not substantially reduce the risk, and actually increased it on average. I'm pretty sure there's a more recent followup paper, but I can't find it just now.
The 2016 Obama Administration also released a report summarizing the scope of the threat of automation. The main conclusions were that those with limited education, and jobs requiring a low amount of skill, were at greatest risk. They also pointed out that around 6% of US jobs are lost each quarter already though (and simply replaced by new jobs), so the proposed rate of job loss (up to ~50% over ~15 years) represents about a 15% increase in the rate of churn, which seems adaptable.