The most common is to have a job at a company or work as a freelancer for multiple clients.
Create web, mobile and/or desktop apps where you can have ads or in app purchases.
Write and sell ebooks and/or physical books.
Create a blog and monetize it via ads , sponsorship,affiliate products or sell your own products.
Work on open source projects and get donation and sponsorships.
Create a youtube channel on topics like tutorials, developers lifestyle, tips and tricks, news in the field, etc.
Participate in coding challenges, participate in a bug bounty programs.