Depending on where you have your data from, there should be some information that allows to connect the points in a certain order. If you really have only the geometry (points) with no further information, you can try the follwowing - it's not perfect, but if your points are near enough, the solution should be satisfying, maybe needs some manual adjusting:
Menu Processing / Toolbox / Join attributes by nearest (1 and 2 on the screenshot below). Select twice your points as input layer and set
Maximum nearest neighbors to 2. Run the tool and you get the same points as output in a new layer (3), but containing additional attributes: distance, feature_x, feature_y, nearest_x, nearest_y. So for every point, you get it's coordinates as well as the coordinates for the nearest neighboring point. In fact, you get two points for each input point, as we defined to create the 2 nearest neighbors.
You can use this information to create a line with QGIS expressions - either as new symbol layer with geometry genarator (for visualization purpose only) or by using the tool
geometry by expression (from the toolbox) to creat an actual line.
In the screenshot, you see the resulting line using a new symbol layer (4), set it to geometry generator, geometry type line and use this expression (5):
make_line ( make_point ( "feature_x" , "feature_y" ) , make_point ( "nearest_x" , "nearest_y" ) )
This creates the blue line you see on the screenshot that connects the red points.
If you want to create an actual geometry, paste the same expression to the
geometry by expression tool.