Yes, with Magic Jar
Warlocks with the Genie patron (from Tasha's Cauldron of Everything, p. 73) have an expanded spell list that is adding wish as a 9th spell level option to your available spells (accessible through the Mystic Arcanum feature).
Wish will allow you to cast magic jar. Magic jar in turn will allow you to possess another creature, and use all your class features while doing so and while your own body stays back at home in bed.
Once you possess a creature's body, you control it. Your game statistics are replaced by the statistics of the creature, though you retain your alignment and your Intelligence, Wisdom, and Charisma scores. You retain the benefit of your own class features.
Note that this does not protect you from dying, because
If the host body dies while you're in it, the creature dies, and you must make a Charisma saving throw against your own spellcasting DC. On a success, you return to the container if it is within 100 feet of you. Otherwise, you die.
(Magic Jar works for any other classes that can use it too, of course. For example a wizard could cast it naturally at level 11, as it it part of the standard wizard spell list, a bard could get it with Magical Secrets at level 14, etc. I focused on Warlock, because the question seems most interested in that).