How to quickly level up in Borderlands 4 : short version
From level 1 to 30 it’s best to just complete the main missions and clear different bases and forts. Don’t forget about side quests! They give you not only experience but also cool rewards: new weapons or outfits for your hero. And after level 30, you can keep grinding on bases, but also take the "Junk Hunt" quests.
How to quickly level up: detailed
At the start of the game just follow the storyline. Main missions give a lot of XP to help you level up quickly. And don’t skip bases and forts - you can gain good XP there too!

Until you reach level 30, you can mix things up: sometimes story missions, sometimes base clearing, and also take side quests. In addition to XP, you can get cool skins and new guns from them.
But after level 30, a feature called "Junk Hunt" becomes available. You need to find and eliminate an especially nasty monster there. These quests are done quickly, and the XP you get from them is huge!

If you switch between different ways of leveling, you won’t waste much time on developing your character.