How to make a hover jump in a 2d side scroller?

Hi, I’ve been trying to figure out a way to add a hover jump to my 2d side scroller game, I want to find out a way to allow my character to float/hover slowly up or down depending on if the player holds down the up or down key, I was wondering if anyone knew how I could do this, or something like it?