I saw this question asked before, but I don't believe it was answered.
Regardless, I've read a bunch of stories about how various ambitious members of the nobility--in multiple cultures, but I'm going to focus on ancient China--in line of succession would be having each other assassinated.
It seems that plenty of people would have to be born into such a situation but not be good at those politics, and some might even know they weren't good at it. What were their chances of getting out of the game entirely and going off to do something safe and boring with their life?
"At the end of the year, all kings [enfeoffed princes of the Han imperial family] sent messengers to the court [of Emperor Ming of the Han dynasty] for the customary New Year's congratulations, unless they went in person. At such an occasion, [king of Beihai Liu] Mu asked his messenger what he would answer if the court inquired about him. The man said he would truthfully state that the king was loyal, filial, compassionate, benevolent, respected worthy persons, and enjoyed the company of gentlemen. Mu exclaimed that this would endanger him. The messenger should say that the king's ambitions had declined, that he amused himself with music and women, and that he loved dogs and horses."
As can be inferred from this passage, it was possible (and often desirable) for imperial relatives, whether sons, brothers, nephews, or cousins, to portray themselves as unambitious, frivolous, and engrossed in an apolitical life. At the same time, it was important for the relative to appear obedient and responsive in relation to court instructions or protocols, as we see here; had the king failed to send a messenger, this would have been a sure sign of rebellious intent. Through such machinations, imperial princes could convince their relative on the throne that they meant no harm, and had no aspirations of advancement. This approach likely worked best in dynasties like the Han, in which imperial princes were often sent away from court to reside at fiefs throughout the empire, and deprived of political power. But distance alone was often not enough - care had to be given to one's personal activities, to avoid the appearance of anything that might suggest ill will toward the emperor. The Han relative referenced above lived during a particularly paranoid era at court, during which Emperor Ming persecuted and ultimately killed some of his brothers after their reckless activities (indulging in witchcraft and other occult practices) convinced the emperor that they were plotting against him.
So devoting yourself to cultural pursuits, keeping your physical distance from court, obeying imperial summons, and portraying yourself as something of an unambitious loser were all good ideas. The appearance (or reality) of extreme unintelligence could also help you - Liu Hui, the uncle of the murderously erratic Emperor Qianfei of the Liu Song dynasty in Southern China, was perceived as so lacking in brightness that the emperor did not fear him. Jumping ahead to another politically dynamic era at court, the reign of Emperor Xuanzong of Tang, we find that another strategy was to maintain a very close, trusting relationship with the reigning emperor, something made easier if he was a brother or otherwise close relative. Despite significant political upheaval at the outset of this reign, Emperor Xuanzong continued to spend a great deal of time with his brother engaged in non-political, recreational pursuits. In turn, his brothers - notably his elder brother Li Chengqi, who had abdicated his inheritance rights some years back - showed no political ambition and behaved very deferentially, ensuring that they remained in the emperor's good graces.
The situation was even more fraught in dynasties that consciously empowered imperial princes, like the Southern Dynasties that ruled from Jiankang between 318 and 589 CE. Here, even if you were careful and discreet, and well-liked within your family, your status as an imperial relative meant that you could be a plausible pretender for the throne (especially if you were a son of a current or former emperor). So you had to be dealt with if your reigning relative was to rest easy on the throne. Accordingly, sons and grandsons of recently deposed emperors - even ones overthrown by close, otherwise amiable members of the same family - were often slaughtered. By way of example, Emperor Ming of Southern Qi had been very close with his uncle, Emperor Gao, but after seizing the throne from the latter's great-grandson executed a significant number of Emperor Gao's descendants despite apparently crying and mourning in advance of each murder. So it's entirely possible that as careful as you were, you might not have been able to avoid a bad outcome.
But, in short, if you were an imperial relative and wanted to avoid political infighting, the surest bet would be to find yourself a fief far away from court, and if you couldn't, then to show no signs of ambition and cultivate a recreational friendship with the emperor. And if none of these were options, then playing dumb might have been a decent bet!
EDIT: You did NOT want to meet with officials, especially not in private at your residence. The crown prince was generally given a household and official advisors, but other princes, unless they were holding a ministerial office or generalship (common in some dynasties, almost unheard-of in others) were generally to refrain from meeting with ministers and lower-tier bureaucrats. To do so exposed the prince to allegations of conspiracy against the throne and was easily used as an excuse for deposition or worse.