You can do this in a huge number of ways. Your 4% can be made up from any combination of interest, dividends, capital gains, rental income, annuities, or whatever else is available to you.
If you buy exclusively high-dividend-paying stocks, for example, you may be able to get most or all of your 4% just in dividend payouts, which is a very simple way to do it. These types of stock also tend to be relatively low risk because they're usually large established companies
like these. Generally these stocks do not have as much capital appreciation, which is the trade-off.
Bonds also pay out dividends, which include the interest from the bonds. Vanguard's Total Bond Market Index Fund payed out just over 2.5% with its most recent dividend payout.
Alternatively, you could sell shares of stocks or bonds and realize capital gains.
In practice, you'll likely do a bit of both. If your expected dividend payout is ~2%, you can sell off 2% of your portfolio to get you up to 4%.
For me, I find the prospect of selling shares to be a lot scarier than just having my dividends paid out, so I'm not sure what I'll end up doing.