Core component of SQL Server for storing, processing, and securing data
The database files are supposedly currently in C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Data. I say "supposedly", because you might have opted to put the database files elsewhere or set different options when you installed SQL Server. Here I am assuming that you have gone with the defaults.
You are likely to find a number of files here, but you should recognise the files for you critical database by the file names. There are at least two of them, one .mdf file and one .ldf file. There could be more than two files, but that is only if you have created multiple files.
Copy these files to C:\Program Files\Microsoft SQL Server\MSSQL16.SQLEXREPSS\MSSQL\Data. (Again, I am making the assumption that you have gone with the default). Then run this in a query window:
CREATE DATABASE yourdb ON (NAME = 'yourdb', FILENAME = '<path>.mdf')
LOG ON (NAME = 'yourdb_log', FILENAME = '<path>.ldf')
FOR ATTACH
I would not be surprised if this fails with the error Access is denied. In this case you need to change the ownership of the files to the account NT Service\MSSQL$SQLEXPRESS. (Again, assuming that you went with the defaults.)