bpy.data.objects['object_name'].select_set(True)
import bpy
sleobj = bpy.context.selected_objects
bpy.data.objects['OBJECT'].select = True
ob = bpy.context.scene.objects["Cube"] # Get the object
bpy.ops.object.select_all(action='DESELECT') # Deselect all objects
bpy.context.view_layer.objects.active = ob # Make the cube the active object
ob.select_set(True) # Select the cube